+1-888-365-2779
Try Now
More in this section

Forums / Designing & Styling / News list: displaying 2nd most recent article

News list: displaying 2nd most recent article

4 posts, 0 answered
  1. Scott
    Scott avatar
    4 posts
    Registered:
    20 Jun 2013
    01 Aug 2013
    Link to this post
    Is it possible to start a news list with the 2nd most recently published article? I want to avoid any manual intervention, so additional tags or categories wouldn't work here.

    I have two separate news lists, with the first displaying the most recently published article. To avoid duplication, the other list needs to display everything from the 2nd most recently published article.

    Any suggestions very gratefully received!
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    01 Aug 2013 in reply to Scott
    Link to this post
    I think you'd need a custom control to grab the second most recent...(So like .OrderBy(x => x.PublicationDate).Skip(1).Take(1) ) I don't think a filter or sort expression would work in the default control.

    ...I mean you COULD always just show "2" and use CSS to hide the first item if you aren't that concerned about there being 1 invisible item. <newsitemclass>:first-child{ display:none}

    ?
  3. Scott
    Scott avatar
    4 posts
    Registered:
    20 Jun 2013
    02 Aug 2013 in reply to Steve
    Link to this post
    Thanks Steve; I'll look in to the custom control option. Unfortunately, I need to use first-child to apply a different style to the first item, otherwise I'd happily use this.
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    02 Aug 2013 in reply to Scott
    Link to this post
    Okay, nth child?

    http://www.w3schools.com/cssref/sel_nth-child.asp

4 posts, 0 answered