Jump to:

22977 Posts in 11806 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » page two of news holder page needs to have NO hero...

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 607 Views
  • zim
    Avatar
    Community Member
    135 Posts

    page two of news holder page needs to have NO hero... Link to this post

    I have a news holder page on which the first news story is displayed defferently to others (eg as a hero). I achieve this by using the <% if first %> page control. and the rest of the stories are displayed in the standard way.

    I have set up paging on the holder page so only 9 are displayed on each page.

    My problem is that when I page to the next page I do not want the hero to appear. rather that all the stories are then displayed normall. This is because I only want the first story in my cms to be displayed as hero.

    Does this make sense? Does anyone know how I might acheive this?

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: page two of news holder page needs to have NO hero... Link to this post

    There is a handy control with DataObjectSet called NotFirstPage, that should do the trick:

    <% if YourDataSet.NotFirstPage %>
    Non-Hero header
    <% else %>
    Check out the $Top.$Hero
    <% end_if %>

  • zim
    Avatar
    Community Member
    135 Posts

    Re: page two of news holder page needs to have NO hero... Link to this post

    Perfect. Thanks

    607 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.