Module Builder - Filter by Custom Field

Posted by Community Admin on 05-Aug-2018 01:23

Module Builder - Filter by Custom Field

All Replies

Posted by Community Admin on 22-May-2013 00:00

I have created a related field using the "array of id's" and the dynamic content select custom field created by Thunder. I want the ability to filter the backend list view by the values in that custom field just like fields that are bound to categories (in the sidebar section). 

How can I achieve this? Please send a code sample. Thanks!

Posted by Community Admin on 27-May-2013 00:00

Hello Adam,

 The way to do this would be with a custom command widget in the sidebar. Here's a blogpost by Stoimen Stoimenov that shows how to implement the same functionality ApprovalWorkflow state:
http://www.sitefinity.com/blogs/stoimen-stoimenovs-blog/2012/08/30/filtering_dynamic_content_items_in_the_backend_grid_by_workflow_status
The only thing different for you would be the filter expression. The format for the filter expression that you should use in your case would be:
"fieldName.Contains((GUID))" where GUID is the ID of the item by which you want to filter.
 Let us know if this worked for you.

Regards,
Svetoslav Petsov
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 08-Oct-2013 00:00

Were you able to get this to work?  I need to do the same thing and am having trouble getting the right GUID or expression put in.

I went to sf_mb_dynamic_module_field and looked up the record for my related field, but am trying to determine which GUID to use.  I have tried both. ID and Classification ID in my expressions, but neither are working.  I noticed that the Classification ID actually is the parent type Tags.

Things I have tried that result in Object not found errors or similar: (Note: I tried both ID and Classification ID in the below)

 filterExpression : "fieldName.Contains(\"CB0F3A19-A211-48A7-88EC-77495C0F5374\")"
 filterExpression : "<name of related content field>.Contains(\"CB0F3A19-A211-48A7-88EC-77495C0F5374\")"
filterExpression : "Tags.Contains(\"CB0F3A19-A211-48A7-88EC-77495C0F5374\")"
filterExpression : "Tag.Contains(\"CB0F3A19-A211-48A7-88EC-77495C0F5374\")"

Posted by Community Admin on 08-Oct-2013 00:00

Ok so this is getting me closer to the point that there is no error, just I get an empty grid to display:

filterExpression : "<name of related content field>.Contains(\"CB0F3A19-A211-48A7-88EC-77495C0F5374\")"

I notice there are additional things that happen when taxonomies are used that trigger a dialog so I will start trying to mimic that to see if I get anywhere.  

For instance I have a product-categoriesCommand that was generated by Module Builder that shows up under (Sections/Sidebar/Filter/Items) and then a corresponding node "productcategories" under (Sections/Sidebar/Filter)

This thread is closed