Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Terry Clancy 204 posts 944 karma points
    Apr 09, 2015 @ 18:22
    Terry Clancy
    0

    Need guidance on creating various renderings of a news feed please.

    Hi All

    I am wanting to create a news feed with various renderings as follows

    1. One page per news item – I know how to do this by creating Data Types and a Document Type to support the information I want to create and then a Template to display it as desired all on one page. Then create Content pages to create one instance of the template per News Item

    2. I also want to create a News Summary Page this will list each news item one after the other with just the title and abstract or perhaps the first few sentences of the body copy from the news item.  If there is more than a defined number or articles (say 10) then this page should also automatically display as several pages with a pager control to allow you to navigate between the pages.  I am not sure how to do this please ??? Any pointers would be appreciated.

    3. I also want to be able to select the top 2 (or so)  articles and highlight their content on my home page. I am not sure how to do this please ??? Any pointers would be appreciated.

    Thanks in anticipation.

    Terry Clancy

    ClanceZ

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 09, 2015 @ 19:20
    Dennis Aaen
    100

    Hi Terry.

    Try to see this examples taking from the starter kit called TXT, I am sure that this can help you.

    2. Yes it would be possible. There is different ways that is recommended to do this. Some recommend to use overflow:hidden in CSS where you set a hight on the the element, because then you get the whole text in the HTML, and Google loves this. In Razor, you also have the truncate method that can take x numbers of charcters and then you can add three dots. But with this solution you can risk that it will cut in a sentence.

    @Umbraco.Truncate(CurrentPage.bodyText, 122)

    Documentation can you find here: https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/#Truncate%28stringhtmlintlengthbooladdElipsis%29

    3. Yes you can pull out the 2 newest news item or 3 if you want. Here is an example on how to take the 5 newest articles. By using the ,Take(5) https://github.com/umbraco/Starterkits/blob/master/Txt/Txt/Views/Partials/umbNewsOverviewWidget.cshtml

    Hope this helps, if not, please ask again, and I can help you further.

    /Dennis

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 09, 2015 @ 20:16
    Jan Skovgaard
    0

    Hi Terry

    Just want to throw my 2 cents in regarding 2 question :)

    I will encourage you to consider using text-overflow - Read more about it here http://www.mobify.com/blog/multiline-ellipsis-in-pure-css/ - It has the benefit of the text not being cut of at a weird place in regards to the text that search engines and screen readers so it is beneficial for indexing and if the content is consumed by a screen reader rather than a visual browser.

    Hope this helps.

    /Jan

  • Terry Clancy 204 posts 944 karma points
    Apr 10, 2015 @ 08:51
    Terry Clancy
    0

    Dennis and Jan ,

     

    Thanks a lot for the tips. 

     

    Terry

Please Sign in or register to post replies

Write your reply to:

Draft