More in this section

Forums / Developing with Sitefinity / Change Content by Query String

Change Content by Query String

2 posts, 0 answered
  1. Jason Hedges
    Jason Hedges avatar
    22 posts
    16 Jul 2009
    07 Jun 2010
    Link to this post
    We are building a site for a company that has locations in 3 cities. Their website has the same pages for each city but clicking a city link adds a query string parameter so that the content can be customized per city. So, for example, they might have a  /contactus.aspx page that would show Dallas information if they link was /contactus.aspx?city=Dallas. What is the best way to build these type of content pages in Sitefinity where you have a single page with multiple possible content blocks?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    08 Jun 2010
    Link to this post
    Hello Jason Hedges,

    You have to create a custom control that inherits from ContentView class ( or some of its derivates - NewsView, EventsView, BlogPosts ). Then override SetItemContent from where you could access the "fullContent" link . One of the parameters of SetItemContent is IContent object - contentItem, so you can easily change the fullContent link based on the content item and append a QueryString to the url

    Then override SetSingleItemContent method check the QueryString and customize the content of the item that is being previewed.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered