Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

page two of news holder page needs to have NO hero...


Go to End


3 Posts   958 Views

Avatar
zim

Community Member, 135 Posts

29 October 2009 at 11:11pm

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?

Avatar
dalesaurus

Community Member, 283 Posts

30 October 2009 at 7:09am

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 %>

Avatar
zim

Community Member, 135 Posts

30 October 2009 at 11:44am

Perfect. Thanks :)