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 have a similar issue as described here (see link) but this post only seems to get me part of the way hence why I am opening a new thread:
I have an existing site which was using a MacroPartial to generate navigation and I am now trying to add it to a new blog section.
Following the advice on the thread mentionned previously (see link) I have moved the content of my PartialViewMacro into a regular Partial view, changing the initial 'PartialViewMacroModel' for 'Umbraco.Web.Models.RenderModel', which seems required to filter descendants with LINQ.
The old part of the website seems fine with these changes but I am still getting an error with I try to get to the Articulate blog i.e.
The model item passed into the dictionary is of type 'Articulate.Models.ListModel', but this dictionary requires a model item of type 'Umbraco.Web.Models.RenderModel'.
What am I missing? Any help would be greatly appreciated
Hello, I'm trying to achieve the same thing. Any luck?
Yes I managed to find a workaround. In short I created a new Articulate theme and the root document (of the blog) starts with the following:
var siteRoot = Model.AncestorsOrSelf().Last();
var navModel = new Umbraco.Web.Models.RenderModel(Model);
Then comes my HTML (copied from the old part of the site for a similar look) with the call to the partial with the navigation
The view starts with the following:
//From the currentpage - get the root node (Select the node at level 1)
var rootNode = Model.Content.Site();
var selection = rootNode.Children.Where(x => x.IsVisible());
Then the HTML where I enumerate the descendants
@foreach (var item in selection)
Hope this helps :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted