Page 1 of 1

Re: Howto? Childlisting in content with images

Posted: Sun Jun 13, 2010 10:48 am
by Peciura
Installed module CGSimpleSmarty.
Created dir '/uploads/images/section_header_pics' and copied CMSms logos to it.
Than set the same template for all child pages (NCleanBlue)
In the template (NCleanBlue) added extra content block tags just after {content} tag
{content}
{content_image block='Overview Picture (for list page)' dir='images/section_header_pics' urlonly='true'}
{content block='Overview Text (for list page)'}  
Added this smarty code to parent page
{$cgsimple->get_children('','','children')}
{if count($children)}
{foreach from=$children item='child'}
{if $child.show_in_menu}

{$cgsimple->get_page_content($child.alias,'Overview_Picture_(for_list_page)','temp')}
{*image or alt text*}
{$cgsimple->get_page_content($child.alias,'Overview_Text_(for_list_page)', 'temp')}
{eval var=$temp} {*text from extra textual content block*}
{$cgsimple->get_page_content($child.alias,'', 'temp')}
{eval var=$temp|strip_tags:'false'|truncate:'80':'...........'} {*main content with stripped tags and truncated text*}
{cms_selflink page=$child.alias} {*link to page*}

{/if}
{/foreach}
{/if}
There is another way to do this with MenuManager but this might be shorter and still valid with CMSms 2.0 in the future.