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.

Data Model Questions /

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

Controlling pages in groups of certain size


Go to End


10 Posts   5026 Views

Avatar
Boogiez

Community Member, 17 Posts

7 February 2009 at 8:21am

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!

Avatar
BLU42 Media

Community Member, 71 Posts

7 February 2009 at 9:47am

Nice work simplifying that a bit!

-John

Go to Top