Developer forum

Forum » Templates » RenderItemList - custom parameters

RenderItemList - custom parameters

René Poulsen
René Poulsen
Reply

Hi,

I don't think it is possible, but worth a question here: is it possible to send custom parameters to an ItemPublisherList template using the RenderItemList.

Let's say I have 1 item based page (on this item I can choose 1 image). From the template for this item I want to show some other items using RenderItemList. On theese items there's an image field as well. If this field does not contain anything, I want to use the image from the original item. So what I basically want to to is to use this in my page template (for the item based page):


@RenderItemList(new {
           ItemType = "MyItem",
           ListSourceType = "Area",
           ListSourceArea = Pageview.Area.ID,
           ListOrderBy = "Sort",
           IncludeAllChildItems = true,
           IncludeParagraphItems = true,
           ItemFieldsList = "*",
           ListTemplate = "itempublisher/list/myitems.cshtml",
           ListPageSize = 100;
           FallbackImage: @GetString("Item.FallbackImage")
       });

And then access the "FallbackImage" in the "myitems" ItemPublisher list template.

Is this possible? If not, a possbile future feature? :-)


 


Replies

 
Nicolai Pedersen
Reply

That is not possible like that - but this is C# all running in the same request, you could add the data to httpcontext.current.items and retrieve inside the other template...

BR Nicolai

 

You must be logged in to post in the forum