17488 Posts in 4473 Topics by 1978 members
|Go to End|
8 November 2007 at 12:37pm
I previously used CMS system called Mephisto that run on Ruby on Rails. I'm looking for similar functions with SS and not sure I can figure it out. What I need is:
Latest article titles from section to appear on the template in separate div. For instance three latest titles from the blog section to appear in blog div on template.
I'm sure there is a way to do it. I'm just stupid and can't figure it.
Thank you in advance.
Core Development Team
8 November 2007 at 1:16pm Last edited: 8 November 2007 1:20pm
Tutorial two will take you through doing this, however as a really simple example on how to do this you could use
<% control ChildrenOf(latest-news) %>
<a href=$Link> more </a>
<% end_control %>
This would assume you have a page with the URL "latest-news", and you want to loop though all it's children, display a summary of the first 50 words, and then provide a link to the main article.
Just put this code anywhere in your tempalte
8 November 2007 at 1:26pm
I appreciate your help on this.
I'm going to try it.
8 November 2007 at 5:31pm
I got it working. Now I'm trying to figure out to do the same with the blog page so it will display few of the blog children. This is what I came up with:
<% if blog %>
<% $Content.LimitWordCount(20) %>
<a href="$Link"> more </a></p>
<% end_if %>
So far no luck but probably I'm doing something wrong again. Also some how I want to limit the number of children instances on the page. If you have ideas it would be great. I'm trying to learn from my mistakes.
8 November 2007 at 6:20pm
if you are on the blog page template and want to control its children you can just use <% control Children %>
9 November 2007 at 1:09am
Thank you for responding to my post.
So far I have single template to accommodate my website and I'm not sure hot to add a separate template for particular section. In the main content section I have this code:
$Content $Form $PageComments. If I will add this code <% control Children %> as you suggested it will control children of all sections unless it is on the separate template. It would be great if you could suggest how to assign a separate template to a section.
Thank you in advance.
|Go to Top|