17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1155 Views |
-
Display a range of articles

10 October 2008 at 11:11pm Last edited: 10 October 2008 11:12pm
Hi,
On the news holder page of my website I am wanting to highlight the latest 3 articles seperately and have the rest of the articles display in a list format.
I know how you can display the top 3 articles (as per tutorial) but is their any way silverstripe can extract a range (ie 4-10) or (<4)?
Hope you can help.
Thanks
-
Re: Display a range of articles

11 October 2008 at 5:01am Last edited: 11 October 2008 5:01am
I believe this would work
<% control News %>
<% control Range(4,10) %>
$Content
<% end_control %>
<% end_control %> -
Re: Display a range of articles

14 October 2008 at 4:39am
Hi LeeUmm,
Thanks for your response. Unfortunately it didn't work for me. I tried as you suggested as follows:
<% control Children %>
<% control Range(0,3) %>
<p><a href="$Link" title="{$Title}">$MenuTitle</a> - $Date</p>
<% end_control %>
<% end_control %>This displays nothing.
If I take out the control Range part it displays all the articles but it just won't work with the range. Is their anything that I might be missing here?
Thanks
Nick
-
Re: Display a range of articles

14 October 2008 at 5:00am
Hmm sorry, I've never used it myself, I had just remembered reading it in the forums a while back.
Just did a quick search and found the topic that I was thinking of.
http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/160555
Maybe some more info there?
| 1155 Views | ||
|
Page:
1
|
Go to Top |


