Click here to Skip to main content
12,749,046 members (38,760 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


Posted 11 Aug 2011

Filtered Search Sample (part 2 - tagging structure)

, 11 Aug 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
CodeProjectFor the second part of the Filtered Search Sample we are going to look at the data layer to support our Filtered Search presentation.

For the second part of the Filtered Search Sample we are going to look at the data layer to support our Filtered Search presentation. The implementation here is being implemented with Sitecore as the data store but the pattern could easily be some other CMS or just a database.



Our filtering is based on searching across the repository for items that have the criteria we are looking for. This requires two basic things. The first being our items need to be tagged in some fashion and the second is that those tags are made available to the user to include or exclude from the results. Above you can see that we have a hierarchical tagging structure. This allows nested tags such as an Article and a White Paper can have the same parent and then we can allow the parent of "Article / White Paper" be used in the Filtered Search.

You can also see that a Tag is more than just a string field. This allows us to associate a Tag with an icon and a description if we want. The PowerFilter property of the Tag is what we are using to tell the system if we want the Tag to be listed in the Filtered Search module. We are using Tags for a lot more than just the FilteredSearch so this field allows us to flag the Tag as an item we want the user to be able to filter on.


Here you see we have a configuration element in Sitecore that allows a content manager to specify the title, the instructions, how many results should be displayed per page and which Tag Categories should be used.


The PowerFilter Sublayout is just an .ascx User Control that inherits from the SublayoutBase - if you are not familiar with Sitecore it is merely a base class that makes it easier to get access to the context in which the control is being used. Here we are setting the context of control to the PowerFilter item we just discussed. We are binding an ASP.NET Repeater to the Tag Categories chosen and we actually have a repeater within a repeater that will list out each Tag within the Tag Categories if it's PowerFilter property is set to true.

Next Up

We have covered the presentation and now the tagging structure we setup using Sitecore; next we will go into implementing the service layer that will respond to the Ajax calls that actually get the results to be displayed.

Permalink | Leave a comment  »


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

James Coleman
Technical Lead Independent Consultant
United States United States
Director, Technical Services

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170215.1 | Last Updated 11 Aug 2011
Article Copyright 2011 by James Coleman
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid