Howto? Childlisting in content with images

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Peciura

Re: Howto? Childlisting in content with images

Post 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.
Attachments
child_list.png
Last edited by Peciura on Sun Jun 13, 2010 10:53 am, edited 1 time in total.
Locked

Return to “CMSMS Core”