Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am developing an Umbraco 7.6 site where I have to use PureLive mode for Model Builder.
Is there a way to share and reuse a common @helper which uses ModeBuilder generated class between different Views/Partialviews?
If I put it in App_Code folder, it won't compile since the ModelBuilder generated class are not available to the compiler...
Is there a way to "include" one .cshtml in another?
I have previously been able to add a cshtml named App_Code/MyProject/GlobalHelpers.cshtml.
In this I had the following:
@helper RenderBreadcrumb(int id)
var uh = new UmbracoHelper(UmbracoContext.Current);
var basenode = uh.TypedContent(id);
var nodes = basenode.Ancestors().Where(x => x.GetPropertyValue("umbracoBreadcrumbHide") != "1");
@foreach (var node in nodes)
<li><a href="@node.Url">@node.GetPropertyValue("navName", node.Name)</a></li>
<li class="active">@basenode.GetPropertyValue("navName", basenode.Name)</li>
In my views I could then type:
And get a breadcrumb.
Don't know if it works with modelsbuilder though, but you can try!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted