More in this section

Forums / Developing with Sitefinity / News story display in a custom page.

News story display in a custom page.

4 posts, 0 answered
  1. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    08 Jan 2010
    Link to this post
    Hi,

    I would like to know how to display the news story on a page created through sitefinity, instead of news item creating its own url for the story page. For example, instead of http://localhost/Test_App/TestContentPage1/10-01-08/First_News_Item.aspx i would like to display the story of any news item clicked on http://localhost/Test_App/TestContentPage1.aspx.

    How can I achieve that ?

    Thanks,
    Saumitra
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Jan 2010
    Link to this post
    Hi Saumitra,

    The news view control can be set up to display the single news items in a page created by you rather than in an automatically generated url. Lets say that you create two pages the one is ~/NewsList.aspx which will show the list of news items and ~/NewsItem.ascx whiph will show single news items (users will be redirected from the ~/NewsList.ascx page to this one).

    1) Place a news view control on both pages
    2) On ~/NewsList.aspx page set the News View control. Open the control for edit, click on News Settings and scroll down. Then select the Use a page especially prepared to hold the full info and select the page. See attached image.
    3) On ~/NewsItem.aspx page open the News View control and click on Advanced tab. Set Behavior Mode to Details, then go to section Explicit Links and set the ItemListUrl to point to page holding the news list, as in attached image.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    11 Jan 2010
    Link to this post
    Hi Georgiev,

    I tried the settings you mentioned. But the result is still the same. Please have a look at the attached screenshots (circled areas in the picture) and let me know if I've missed anything.

    Thanks,
    Saumitra
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Jan 2010
    Link to this post
    Hello Saumitra,

    Thank you for getting back to me.

    As far as I can see the result is not the same, since the the single item is displayed on the ~/NewsDetail.aspx page. The rest of the input that you see in the URL is due to URL rewriting, this is intended for SEO purposes - non readable query strings do not look good to search engines. However you can easily configure what to show in the URL, to do this the news section in web.config has to be configured:
    <add name="News" allowLocalization="true" urlRewriteFormat="ID={GUID}.aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" allowComments="true" applicationName="/News" versioningProviderName="" commentsModeration="true" allowWorflow="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/>

    You can also use an empty string for this property, which will result in URLs like this:
    http://www.mysite.com/NewsDetail.aspx?NewsProv=News&NewsItem=2df394a8-ec61-4946-a654-1fe092483434

    If this method does not satisfy your requirements you can use the Advanced URL Rewriter that Sitefinity provides. For more information on this topic, you can take a look at the following webinar: URL Rewriting In Sitefinity

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered