1) You are using the dynamic CurrentPage property, rather than the strongly typed 'Model.Content' property. Unfortunately Vorto currently only supports the strongly typed version. You can do everything you can do with the dynamic property with the strongly typed methods, but it means you'll have to change how you get some properties like @page.date to be more like @(page.GetPropertyValue<DateTime>("date")) instead.
2) Once you are using the strongly typed model, you shouldn't need to use.Content within the loop as page should already be of type IPublishedContent (you only need it in your standard view because the current pages IPublishedContent is accessible via a .Content property on @Model)
It might be worth you taking a look at the docs regarding the difference between CurrentPage and Model.Content if you are not already familiar with this.
vorto values inchildren loop
HI , cant seem to get values in a loop.
whats wrong with this?
Hi Peter,
I see two issues from a Vorto perspective.
1) You are using the dynamic
CurrentPage
property, rather than the strongly typed 'Model.Content' property. Unfortunately Vorto currently only supports the strongly typed version. You can do everything you can do with the dynamic property with the strongly typed methods, but it means you'll have to change how you get some properties like@page.date
to be more like@(page.GetPropertyValue<DateTime>("date"))
instead.2) Once you are using the strongly typed model, you shouldn't need to use
.Content
within the loop aspage
should already be of typeIPublishedContent
(you only need it in your standard view because the current pagesIPublishedContent
is accessible via a.Content
property on@Model
)It might be worth you taking a look at the docs regarding the difference between
CurrentPage
andModel.Content
if you are not already familiar with this.http://our.umbraco.org/documentation/Reference/Templating/Mvc/views
Hope this helps
Matt
Hi,
So i should get the children something like this? This fails thou, cant seem to find the way to do it from your link.
var selection= Model.Content.Nyhed.Where("Visible").OrderBy("date desc");
Hi, after fiddling around, i got it to work. Thanks.
Nice work Peter.
I think it's way more valuable to help a person discover the answer rather than to just give it outright, so well done on getting it working.
Matt
is working on a reply...