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.

General Questions /

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

Control only last (any choice of #) pages created?


Reply


433 Views

Avatar
wilsonStaff

Community Member, 142 Posts

4 February 2012 at 3:58pm

HI guys,

- i have a sub-pages systems that CMS-users add members (using a custom MembrePage class) to a lettered-class ordering, from A to Z.

- those section A to Z are childs of a main page, name MemberAll.

- so if client add a member whose companie's name begin with a "B", the page is added into the B sub-section.

- i have a page (NewMembrePage) that MUST display the latest entries within the MembreAll page (so within A - Z sections

Presently, end-users add the new entries manually, so both into the B-section AND into NewmembrePage

QUESTION: how can i have the NewMemberPage reflects the new entries, be they from D, H or any lettered-section?

Ive read about $Created.Nice that returns the date of creation.

In my head, the code would be like:

//*** IN NEWMEMBREPAGE ***//

<% control Page (MembreAll) %> /* look into MembreAll page */
<% control Children %> /* look into all lettered sections from A - Z pages */
$Created. Last(5) /* pick the last 5 created */
<% end_control %>
<% end_control %>

if i wanted to show last 5 entries.

Know its not that, but thats what id like to do.

Any clue?

Thanks!