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'm using the MultinodeTreePicker to select related content. Is it possible to display custom properties?
My code:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage if(@CurrentPage.HasValue("trainingen")) { foreach (var item in @CurrentPage.trainingen.ToString().Split(',')) { var page = Umbraco.TypedContent(item); if(page != null){ <div> <a href="@page.Url"> @page.Name </a> </div> } } }
When I use @page.CustomPropertie the error says "'Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'CustomPropertie'".
What is the best way to do this?
Try this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage if(CurrentPage.HasValue("trainingen")) { foreach (var item in CurrentPage.trainingen.ToString().Split(',')) { var page = Umbraco.Content(item); if(page != null){ <div> <a href="@page.Url"> @page.Name </a> </div> } } }
Hi Jeavon,
Thaks for your reply. The error now says:
Compiler Error Message: CS0117: 'umbraco.page' does not contain a definition for 'Url'
Bas
Ah, need a Razor block:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ if (CurrentPage.HasValue("trainingen")) { foreach (var item in CurrentPage.trainingen.ToString().Split(',')) { var page = Umbraco.Content(item); if (page != null) { <div> <a href="@page.Url"> @page.Name </a> </div> } } } }
Great! This is working!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Custom properties on MultinodeTreePicker
I'm using the MultinodeTreePicker to select related content. Is it possible to display custom properties?
My code:
When I use @page.CustomPropertie the error says "'Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'CustomPropertie'".
What is the best way to do this?
Try this:
Hi Jeavon,
Thaks for your reply. The error now says:
Compiler Error Message: CS0117: 'umbraco.page' does not contain a definition for 'Url'
Bas
Ah, need a Razor block:
Great! This is working!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.