Filtering by Tags in a Visualizer

Overview

You may want to display only specific content items on a page or a visualizer. You can achieve this with the help of a native filter of DNN that uses tags in the URL as a means of filtering.

 

Prerequisites

  • Version Evoq 9+

 

Solution

  1. In the Persona Bar, select Content and then choose Content Library.
  2. A list of your site's content items will display. Navigate to the content item that you want to tag for filtering and click the corresponding Edit icon.
    NOTE: The Edit icon appears as a gray pencil.Add_Content_to_Library_Screenshot_1.png
  3. Select the Properties tab and include your tag(s) in the Tags field and click the Save button when finished.
    NOTE: Regarding how you could add tags, consider this example: You want to include a certain tag only to content that was created in the year 2019. You could add "2019content" as a tag to all items that were created in the year 2019.
     If you have many entries, you can use the API for this.

    Add_Content_to_Library_Screenshot_2.png

You can use the filter string by appending the following ?filter=tag1,tag2. For example, you can put the URL like https://test.dnndev.me/testpage?filter=tag1,tag2 (URL for reference only). In this scenario, it will only filter out content items that have the tags "tag1" and "tag2".

From the example above, it will filter content items with tags "tag1" and "tag2". It cannot filter "OR" wherein it either filters either "tag1" or "tag2".

 

Testing

You should now be able to add to the URL where your visualizer is ?filter= followed by the tag to only display tagged content. For example, yoursite.com/?filter=2019content will only show items with the "2019content" tag.

Comments

2 comments

  • Avatar
    Nikhil Ramrakhiani

    Does URL filtering support multiple tags? If so, what would be the syntax?

    1
    Comment actions Permalink
  • Avatar
    Karyn Letendre

    I would also like to know this answer, Does URL filtering support multiple tags? If so, what would be the syntax?

     
    0
    Comment actions Permalink

Please sign in to leave a comment.