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

Forums / Developing with Sitefinity / Append news item tags to its querystring

Append news item tags to its querystring

2 posts, 0 answered
  1. James
    James avatar
    4 posts
    Registered:
    25 Aug 2012
    19 Aug 2009
    Link to this post
    Hi,

    I have been trying to figure out a simple way to append a news items tags to its querystring when it is selected in ListPageMaster.ascx - i.e. I want the news items querystring to look something like this: www.site.com/news/09-08-18/Name_Of_News_Item.aspx?ArticleTags=Sport,Golf,USA

    The idea is to customise the ListPageDetails.ascx control to include a secondary news control that contains a list of related news items.  I would like to filter the related news list to show only news from the same category and having tags in common with the primary news item.

    The category part is easy using Ivan's very useful MetaMaster2008 control.

    The bit I'm having trouble with is applying the second filter - filtering to show only news items that have tags in common with the primary article.

    Any ideas very much appreciated.

    James
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Aug 2009
    Link to this post
    Hello James,

    Here is how I imagine such scenario:

    1. You should be having two custom controls, based on NewsView. 
    1.1. The first one will form the Full Urls (details URLs, the one having the tags in the query string). It will also be able to extract the tags related to the each content item. Let me know if you need help with this control.
    1.2. The second one will be able to read the tag collection from the query string. Тhen here comes the different part

    2. The tags cannot be used in FilterExpression more than once. That said, if you filter by several tags, only the last one will be counted. This is going to be resolved in the 4.0 version. 
    What you can do except using a second NewsView control is to build a custom control which will show the titles of the news only. For that purpose you should iterate through the News items and use intersection - a collection with items having every tag you need. 

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
2 posts, 0 answered