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

Forums / Developing with Sitefinity / Tags display for custom module based on generic content

Tags display for custom module based on generic content

4 posts, 0 answered
  1. Kameo
    Kameo avatar
    13 posts
    Registered:
    23 Feb 2006
    05 Nov 2008
    Link to this post
    I've created a custom control "Business" based on the Products example and I've added Tags to it.  I've added the Tags List to the page and I've added my Business Provider to pull my list of tags.  When I click on a particular tag it filters my results by that tag. 

    I would like to do a couple things:
    1.  I would like to show the user the tag that they clicked on
    The url shows a Guid which I assume is the ID for that tag.  I would like to show the user which tag is currently being filtered but I can't figure out how to get the name of the tag.

    2.  I would like to filter the tags available by category
    I only want to display tags that are available for items that also belong to a specific category how would I go about doing that (if that's possible)?
  2. Kameo
    Kameo avatar
    13 posts
    Registered:
    23 Feb 2006
    05 Nov 2008
    Link to this post
    Ok I figured out the first part by creating a custom control that grabs the guid and gets the tag name:

    if (Request["CntTagID"] != null)

    {

    BusinessManager bm = new BusinessManager("Business");

    Guid g = new Guid(Request["CntTagID"]);

    tagName.Text = bm.Content.GetTag(g).TagName;

    }

    it's hacky but it works ok.  is the second part possible?

  3. Kameo
    Kameo avatar
    13 posts
    Registered:
    23 Feb 2006
    05 Nov 2008
    Link to this post
    I've hacked together a solution by building a tag list from a filtered list of contents.  I also realized I probably posted in the wrong place.
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    10 Nov 2008
    Link to this post
    Hi Kameo,

    I am glad that you have found the solution. Actually, you can get this to work with ContentView control as well, just make sure that the TagItemKey of the ContentView control and TagsList control are the same (e.g. "BussinessTagID"). This key is basically specifying the query string key in which the Tag id will be stored. In order for the two controls to work together, they both need to operate on the same query string (in your case below it was CntTagID).

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Kind regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered