More in this section
Forums / Developing with Sitefinity / Append news item tags to its querystring

Append news item tags to its querystring

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. James
    James avatar
    4 posts
    25 Aug 2012
    19 Aug 2009
    Link to this post

    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:,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.

  2. Georgi
    Georgi avatar
    3583 posts
    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,
    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