Developer forum

Forum » CMS - Standard features » Pass values to RenderItemList

Pass values to RenderItemList

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

Is it possible to send values to the @RenderItemList ?

Like this:

string DataFromItem = RenderItemList(new {
            ItemType = "NameOfMyItem",
            ListSourceType = SelfPage,
            ListSourcePage = "3223",
            ItemFieldsList = "*",
            ListTemplate = "ItemPublisher/ListMyItems.cshtml",
            ListPageSize = "100",
            MyValue = "something_I_want_to_send"
        });


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

You can pass any setting that is available on the paragraph settings using this method. But if you invent your own, it does not get passed to the item publisher templates.

But I think you might be able to use something like HttpContext.Current.Items.Add("someSetting", value) just before you call the RenderItemList and then get the same value in the ListMyItems.cshtml template instance.

BR Nicolai

 

You must be logged in to post in the forum