More in this section

Forums / Developing with Sitefinity / how show top 3 news full story on a page

how show top 3 news full story on a page

4 posts, 0 answered
  1. cybertiger
    cybertiger avatar
    12 posts
    Registered:
    28 Sep 2006
    12 Jan 2010
    Link to this post
    newsview just can show single one, and contentview can do it but no article title, so how can i archive it?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Jan 2010
    Link to this post
    Hello cybertiger,

    Thank you for using our services.

    I am not sure what you are trying to achieve. Could you please elaborate a little bit more in which control you want to achieve what. You can set the news view control to show what fields and how many items from the news view control editor as in attached image.

    Sincerely yours,
    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. cybertiger
    cybertiger avatar
    12 posts
    Registered:
    28 Sep 2006
    12 Jan 2010
    Link to this post
    Actually im trying show content of latest 3 news, not just a list titles, newsview just can show title or a single item, and that limitation i think just limit the count of list titles, right? I tried to use content view and setting Data to News, it can show news content, but without title.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Jan 2010
    Link to this post
    Hello cybertiger,

    Thank you for explaining the situation further.

    The problem with Content View not displaying news view titles is because of the difference of the meta field names. For Generic Content it is Name and for News it is Title. You can achieve this with the news view also. You just have to map an external template for the News View. First take a look at this article for more information on how to work with external templates.

    After you have the external templates go to ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx and add this to the markup:
    <p>
        <asp:Literal ID="Content" runat="server" Text=""></asp:Literal>
    </p>

    You can remove the Summary literal if you do not want it shown. Then map the control template in the controls config file with this:
    <viewSettings hostType="Telerik.News.WebControls.NewsView">
      <additionalTemplates>
        <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.-->
        <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" />
    </viewSettings>

    Restart the website for the changes to take effect.

    Sincerely yours,
    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