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
Hi Guys,
I cant seem to figure this out and seems like my IF statement is not working at all.
Anyone has any idea why i cant get the last item from my media section to display something different
var slideshow = Model.MediaById(Model.slider); var items = slideshow.Children;if(slideshow.NodeTypeAlias == "Folder"){ foreach(dynamic img in items){ if(img.items.IsLast()) { @:{src="@img.umbracoFile"}: } else{ @:{src="@img.umbracoFile" }, } } }
Even this doesnt work at all
if(img.items.Last()) { @:{src="@img.umbracoFile"}: } else{ @:{src="@img.umbracoFile" }, } }
Any suggestion ?
Just for the record got this working.
Here is the code if someone has the same issue.
if(slideshow.NodeTypeAlias == "Folder"){ foreach(dynamic img in items){ if(img.IsLast()) { @:// do something } else{ @:// something else } } }
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
Display last item from media folder
Hi Guys,
I cant seem to figure this out and seems like my IF statement is not working at all.
Anyone has any idea why i cant get the last item from my media section to display something different
Even this doesnt work at all
Any suggestion ?
Just for the record got this working.
Here is the code if someone has the same issue.
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.