Jump to:

3461 Posts in 1065 Topics by 740 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Controlling pages in groups of certain size

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

Page: 1 2
Go to End
Author Topic: 2462 Views
  • Boogiez
    Avatar
    Community Member
    17 Posts

    Re: Controlling pages in groups of certain size Link to this post

    Got it!

    I modified function Grouping() to be this:

       function Grouping() {
          return (($this->iteratorPos % 6 == 0) && ($this->iteratorPos != 0));
       }

    and modified the relevant stuff in the template to be:

    <div id="group1">
    <% control MyChildren %>
       <% if Grouping %>
          </div>
          <div id="group{$GroupNum}">
       <% end_if %>
       <p>Child: $Title</p>
       <% if Last %>
          </div>
       <% end_if %>
    <% end_control %>

    Works like a charm! Thanks so much for your help. I'll post a link to the page you guys helped me make after its done!

  • BLU42 Media
    Avatar
    Community Member
    71 Posts

    Re: Controlling pages in groups of certain size Link to this post

    Nice work simplifying that a bit!

    -John

    2462 Views
Page: 1 2
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.