+1-888-365-2779
Try Now
More in this section

Forums / Module Builder / Module Builder - Filter by Custom Field

Module Builder - Filter by Custom Field

4 posts, 0 answered
  1. Adam
    Adam avatar
    23 posts
    Registered:
    05 Apr 2013
    22 May 2013
    Link to this post
    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!
  2. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    27 May 2013
    Link to this post
    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
  3. Stacey
    Stacey avatar
    291 posts
    Registered:
    18 Oct 2012
    08 Oct 2013 in reply to Svetoslav Petsov
    Link to this post
    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\")"}
  4. Stacey
    Stacey avatar
    291 posts
    Registered:
    18 Oct 2012
    08 Oct 2013 in reply to Stacey
    Link to this post
    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)
4 posts, 0 answered