More in this section

Forums / Developing with Sitefinity / Duplicated titles crashes the website

Duplicated titles crashes the website

2 posts, 0 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    16 Apr 2010
    24 Jan 2011
    Link to this post
    When user posts two same titles, one for a blog post and one for News...

    Application          Url
    /Blogs                 /11-01-24/SameTitle
    /News                 /11-01-24/SameTitle

    And I access the blog page it works, then if I try to access the News page it doesn't load the content. If I restart IIS and access News then Blogs, the blog post doesn't load.

    How can I fix it?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    26 Jan 2011
    Link to this post
    Hello Bruno,

    Here is how the widgets like News work. All content widgets require URL evaluation. 

    When you drop two content widgets (news, events, blog posts, content list, image gallery, video gallery, download list) on one page, by default they will share the following behavior:

    • Paging
    • Switching to detail mode and back to list
    • URL filtering (by date through the Archive control, or by taxon through a taxonomy control)

    What this means is that clicking a page in one widget will also change the page in the other. Clicking a single item in one widget will switch the other to detail mode, filtering by date would filter both widgets, etc.

    If this is not the desired behavior, there are two things that can be done, depending on the user’s preferences:

    1.       Set UrlKeyPrefix property to a different string in all widgets that should not share behavior

    2.       Do 1, PLUS set the UrlEvaluationMode to “QueryString” (the default is “UrlPath”)

    In the first case, when you do an action of the above listed (say click a page), a string will be added to the URL, with the value from the respective widget (whose page you clicked). That way, the application will know to change only the page of this particular widget and not the rest. The URL would still be pretty. The downside to this is that it can only contain information for ONE widget.

    I.e. When you click page 2 of news, then click page 3 of blogs, the string in the URL will only be for blogs, and news will go back to page 1. The upside is pretty URLs.

    In the second case, you can do everything you want. The URL will contain information about all widgets on the page (in the query string), and they will all have different behavior (assuming you set different UrlKeyPrefix).

    THIS IS ALL BY DESIGN. It is all needed, because widgets DON’T KEEP STATE and do NO POSTBACKS.  The UrlEvaluationMode property is the only property in the history of Sitefinity, which is applied PAGE-WIDE. Setting it on one widget will set it for all widgets on the same page (assuming it is a Sitefinity page).

    There’s an option in the properties of all controls to turn off only the URL Filtering. For instance drop News widget and a Blog Posts widget on one page with the default settings for both.

    -       In the front-end, if you click a news item, the News widget will display that item in detail mode. Since this changes the URL (which now includes the date of the item), the Blog Posts widget will filter by that date.

    In almost all cases this is not the desired behavior, but say you don’t want any additional keys in the URL. What you can do is Go to Advanced view of the widgets, then ControlDefinition -> Views -> (name of list view) -> AllowUrlQueries and set this to FALSE. This would stop the widget from filtering and the one that you didn’t click will stay in master mode (list).

    Note that if you have a master-detail scenario between two pages, this would prevent it from working, so only use it in case the widget doesn’t display info after a redirect from another page.

    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