Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Control only last (any choice of #) pages created?

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: 344 Views
  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Control only last (any choice of #) pages created? Link to this post

    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!

    344 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.