http://www.dotnetnuke.com/Resources/Wiki/loc/print/Page/DDRMenu-Razor-templates.aspx
I have a razor script with this info in it:
@using DotNetNuke.Web.DDRMenu; @{ var root = Model.Source.root; } @helper RenderNodes(IList<MenuNode> nodes) { if (nodes.Count > 0) { <ul> @foreach (var node in nodes) { var cssClasses = new List<string>(); if (node.First) { cssClasses.Add("first"); } if (node.Last) { cssClasses.Add("last"); } if (node.Selected) { cssClasses.Add("selected"); } var classString = new HtmlString((cssClasses.Count == 0) ? "" : (" class=\"" + String.Join(" ", cssClasses.ToArray()) + "\"")); <li@classString> @if (node.Enabled) { <a href="@node.Url">@node.Text</a> } else { @node.Text } @RenderNodes(node.Children) </li> } </ul> } } @RenderNodes(root.Children)
However, I get the following error:
Error: test is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: c:\inetpub\vhosts\mysite\httpdocs\DesktopModules\RazorModules\RazorHost\Scripts\ULRazor.cshtml(2): error CS0103: The name 'Model' does not exist in the current context ---> System.Web.HttpCompileException: c:\inetpub\vhosts\mysite\httpdocs\DesktopModules\RazorModules\RazorHost\Scripts\ULRazor.cshtml(2): error CS0103: The name 'Model' does not exist in the current context at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) at DotNetNuke.Web.Razor.RazorEngine.CreateWebPageInstance() at DotNetNuke.Web.Razor.RazorEngine.InitWebpage() at DotNetNuke.Web.Razor.RazorEngine..ctor(String razorScriptFile, ModuleInstanceContext moduleContext, String localResourceFile) at DotNetNuke.Web.Razor.RazorModuleBase.OnPreRender(EventArgs e) --- End of inner exception stack trace ---
When downloading the templates at: http://dnnddrmenutemplates.codeplex.com/ there is an XML (menudef.xml) file included with the ULRazor template.
Where does this go? In the
DesktopModules/RazorModules/RazorHost/Scripts folder? Or someplace else? Or is it necessary?
There are no instructions on how to actually install this module...
I'm on DNN 6.01 / .net 4.0