3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 494 Views |
-
Splitting ChildrenOf

29 January 2011 at 12:47am
Hi Everyone,
Have a quick question I am looking to split the nodes of the ChildrenOf results. For example
<div class="inner-box">
<ul class="bor-none">
<% control ChildrenOf(about-us) DISPLAY FIRST 4 %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %>
</ul>
<ul>
<% control ChildrenOf(about-us) DISPLAY SECOND 4 %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %>
<ul>
<% control ChildrenOf(about-us) DISPLAY THIRD 4 %>
<li><a href="$Link">$MenuTitle</a></li>
<% end
<span class="clear"></span> </div>
</div>Any help would be greatly appreciated !
Thanks
-
Re: Splitting ChildrenOf

29 January 2011 at 12:52am Last edited: 29 January 2011 12:54am
in your Page_controller do something like...
public function LimitedChildrenOf($parentRef,$iLimit) {
$dos = $this->ChildrenOf($parentRef);
return $dos->getRange(0,$iLimit);
}(note untested)
-
Re: Splitting ChildrenOf

30 January 2011 at 3:04am
Thanks swaiba, used the following in the controller:
public function LimitedChildrenOf($parentRef, $offset, $length) {
$dos = $this->ChildrenOf($parentRef);
return $dos->getRange($offset, $length);
}and in the template:
<% control LimitedChildrenOf(directory/mypage/, 0, 4 %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %><% control LimitedChildrenOf(directory/mypage/, 3, 4 %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %>etc
Simples !
| 494 Views | ||
|
Page:
1
|
Go to Top |


