Hello,
I would like to do the following:
on a same page :
1. Display the complete summary of the 6 last articles.
followed by
2. only the titles (and links) of the 20 following ones.
In other words:
Page1: Complete summary for article 1-6, fillowed by title of article 7-27
Page2: Complete summary for article 7 to 12 , followed by title of article 8-28
and so on.
Cheers
Henri
[solved] News display a list articles'title
[solved] News display a list articles'title
Last edited by henris17 on Tue Oct 16, 2012 2:14 pm, edited 1 time in total.
Re: News display a list articles'title
In your Summary template where you do a foreach:
Pre CMSMS 1.11.x with Smarty2
Smarty2 docs: http://www.smarty.net/docsv2/en/languag ... oreach.tpl
CMSMS 1.11.x with Smarty3
Smarty3 docs: http://www.smarty.net/docs/en/language. ... oreach.tpl
Pre CMSMS 1.11.x with Smarty2
Smarty2 docs: http://www.smarty.net/docsv2/en/languag ... oreach.tpl
Code: Select all
{foreach from=$items item='entry' name='pos'}
<!-- show title, for example in unordered list or something -->
<a href='{$entry->moreurl}' title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a>
{if $smarty.foreach.pos.index < 6}
<!-- then here follows the rest of the template for first 6 articles -->
{/if}
{/foreach}
Smarty3 docs: http://www.smarty.net/docs/en/language. ... oreach.tpl
Code: Select all
{foreach from=$items item='entry'}
<!-- show title, for example in unordered list or something -->
<a href='{$entry->moreurl}' title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a>
{if $entry@index < 6}
<!-- then here follows the rest of the template for first 6 articles -->
{/if}
{/foreach}
Re: News display a list articles'title
I suppose you could use some conditional formatting within the uses summary template of the news module.
Name the foreach loop and use the index property to obtain the current
http://www.smarty.net/docsv2/en/languag ... erty.index
Then you could use modulo and check for something like
if index%26 >= 0 and index%26 < 6 then show summary
else show only title
Examples (with section in stead of foreach)
http://www.smarty.net/forums/viewtopic.php?p=67864
Name the foreach loop and use the index property to obtain the current
http://www.smarty.net/docsv2/en/languag ... erty.index
Then you could use modulo and check for something like
if index%26 >= 0 and index%26 < 6 then show summary
else show only title
Examples (with section in stead of foreach)
http://www.smarty.net/forums/viewtopic.php?p=67864
Re: News display a list articles'title
Thanks, I will try this
Re: News display a list articles'title
Instead of Conditional formatting; I think I might use some class and format it in CSS