I'm trying to make a template for the item publisher. The purpose is to display a link if a item relation list, in the items, has content. The attached image "template" is the code i got so far.
I got a short video showing the items with images in the item relation list (the ones that should have links to the items). The ones without should not link to the details page og the items.
https://www.screencast.com/t/cmgTMZfa
Sorry, i'm not very good describing such issues, i hope you guys understand anyway. I hope someone can help us. I've also pasted the template code below...
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @foreach (var i in (GetLoop("ItemPublisher:Items.List"))){ string title = i.GetString("ItemPublisher:Item.Title"); string description = i.GetString("ItemPublisher:Item.Description"); string link = i.GetString("ItemPublisher:Item.Link"); string url = i.GetString("ItemPublisher:Item.Url"); string backgroundcolor = i.GetString("ItemPublisher:Item.ImageBackgroundColor"); string image = i.GetString("ItemPublisher:Item.Image"); string tagclasses = i.GetString("ItemPublisher:Item.Tags.TagName"); tagclasses = tagclasses.Replace(",", " "); string imgwidth = "624"; string imgheight = "351"; foreach (var img in (i.GetLoop("ItemPublisher:Item.ProjectImages"))){ string projectimage = img.GetString("ItemPublisher:Item.ProjectImages.File"); } <figure class="col-3-12 col-small-6-12 no-p no-m hover @tagclasses"> <a href="@url" class="imglink"> <img src="/Admin/Public/GetImage.ashx?Image=@image&Width=@imgwidth&Height=@imgheight&Background=@backgroundcolor&Crop=0" alt="@title" class="img-responsive full-width"/> </a> </figure> }