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
It is been set to the model that I gave for the view
@Html.Partial( "viewname", thisIsNewCurrentPage )
how can I access the content item that was intitially requested from a view that has a differnet content item as an input?
Hi Andrew,
Can you show all your view ?
Thanks, Alex
TopMenu.cshtml
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage@{ var mainMenu = Umbraco.ContentSingleAtXPath("//Folder[@urlName='main-menu']") as DynamicPublishedContent;}
@CurrentPage.Name * what was initially HTTP requested by browser e.g. @Home*
<ul class="sf-menu fixed" id="menu"> @foreach (var menuItem in (mainMenu != null ? mainMenu.Children : Enumerable.Empty<DynamicPublishedContent>())) { <li> @Html.Partial(MyViews.PartialViewPath("Menus/TopMenuItem"), menuItem ) </li> }</ul>
TopMenuItem.cshtml
@inherits UmbracoTemplatePage<DynamicPublishedContent>
@CurrentPage.Name * Is changed every time to the assigned menuItem.Name *
CurrentPage is dynamic object Umbraco.AssignedContentItem is PublishedContent
Do you want to use dynamic objects?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
cannot access CurrentPage/AssignedContentItem from partial view
It is been set to the model that I gave for the view
@Html.Partial( "viewname", thisIsNewCurrentPage )
how can I access the content item that was intitially requested from a view that has a differnet content item as an input?
Hi Andrew,
Can you show all your view ?
Thanks, Alex
TopMenu.cshtml
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var mainMenu = Umbraco.ContentSingleAtXPath("//Folder[@urlName='main-menu']") as DynamicPublishedContent;
}
@CurrentPage.Name * what was initially HTTP requested by browser e.g. @Home*
<ul class="sf-menu fixed" id="menu">
@foreach (var menuItem in (mainMenu != null ? mainMenu.Children : Enumerable.Empty<DynamicPublishedContent>()))
{
<li>
@Html.Partial(MyViews.PartialViewPath("Menus/TopMenuItem"), menuItem )
</li>
}
</ul>
TopMenuItem.cshtml
@inherits UmbracoTemplatePage<DynamicPublishedContent>
@CurrentPage.Name * Is changed every time to the assigned menuItem.Name *
CurrentPage is dynamic object Umbraco.AssignedContentItem is PublishedContent
Do you want to use dynamic objects?
Thanks, Alex
is working on a reply...