Developer forum

Forum » CMS - Standard features » RenderItemList with filtering from Editable List

RenderItemList with filtering from Editable List

António Ramos
Reply

Hi everyone,

We are using a renderItemList with filtering by keywords from product fields or custom fields. All the fields (less the Products) are Editable lists. See below:

string FaqsFilter = "Format contains '"+ProductFormat+"' or RegulatoryStatus contains '"+ProductRegulatoryStatus+"' or Application contains '"+ProductAppAbrv+"' or ProductName contains '"+ProductName+"' or Product contains 'p_"+ ProductID +"' or Clone contains '"ProductClone+"'";

@RenderItemList(new {
ItemType = "FAQs",
ListSourceType = "Page",
ListSourcePage = 6169,
ItemFieldsList = "*",
ListTemplate = "ItemPublisher/List/productRelatedFaqs.cshtml",
ListPageSize = 500,
IncludeParagraphItems = false,
Filter = FaqsFilter
})

The problem with this approach is if we have a product that have p_15 will contain in all p_15*** products or Format field containing "A" will contains in all A*. If we change the contains to equals it doens't work. The editable list in database is comma separated so if we do contains "p_15," it will exclude last products. What is the best approach to accomplish filtering with editable lists?

Best regards,

António Ramos


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Antonio

I have no good answer for you, sorry. Your approach seems ok, but there is limitations.

BR Nicolai

 
António Ramos
Reply

Hi Nicolai,

Thanks for your answer. That is to bad. But anyway I need to solve this question.

Do you know/remember any other way to acomplish what I need (render an item list from a page with filtering).

Best regards,

António Ramos

 
António Ramos
Reply

Hi Nicolai,

While not efficient we workaround this using multiple conditions. e.g. Format contains '"+ProductFormat+"' will be Format contains '"+ProductFormat+",' or Format ends with '"+ProductFormat+"'.

Best regards,

António Ramos

 

You must be logged in to post in the forum