Module Builder - Filter by Custom Field - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Module Builder - Filter by Custom Field

  • Module Builder - Filter by Custom Field
  • 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!
  • 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
  • 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\")"
  • 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)