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
Im using Archetype to make a slider, and need to identify the first "node"
@foreach (var fieldset in Model.Content.GetPropertyValue<ArchetypeModel>("slider")) { @if(fieldset.IsFirst()) { <p>True</p> } else { <p>False</p> } }
What am i doing wrong here?
Hi Claus,
IsFirst is a method only on IPublishedContent, it doesn't exist on with ArchetypeModel, you will need to do something like this:
@{ var slider = Model.Content.GetPropertyValue<ArchetypeModel>("slider"); foreach (var fieldset in slider) { if (fieldset.Equals(slider.First())) { <p>True</p> } else { <p>False</p> } } }
Jeavon
Worked, thanks
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
Checking if node is first node in archetype
Im using Archetype to make a slider, and need to identify the first "node"
What am i doing wrong here?
Hi Claus,
IsFirst is a method only on IPublishedContent, it doesn't exist on with ArchetypeModel, you will need to do something like this:
Jeavon
Worked, thanks
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.