(SOLVED) Problem with $cgsimple->get_children
Posted: Thu Feb 18, 2010 7:25 pm
Hello to everybody.
I have this page structure:
Parent Page
- child1 content_block
- child2 content_block
- childn content_block
The user can add/delete/edit the children pages.
My intention is to include content_block of all n-child pages into one partent page, as a sort of query.
I then tried to search for the help of $cgsimple->get_children.
First, trying with the example loop on documentation page of CGSimpleSmarty:
{$cgsimple->get_children('','',$children)}
{if count($children)}
{foreach from=$children item='child'}
{if $child.show_in_menu}
Child: id = {$child.id} alias = {$child.alias};
{/if}
{/foreach}
{/if}
But with no output.... then I tried a simplified form that is:
{$cgsimple->get_children('','',$child)}
{$child.id}
And even this outputs none; I used that CGSimple code on the template of parent page.
I'm sure that 'Parent' page is recognized to have children with {$cgsimple->has_children()} returning 1.
But I cannot explain this behaviour..
Where is my mistake?
Thank you in advance!
Alex (italy)
I have this page structure:
Parent Page
- child1 content_block
- child2 content_block
- childn content_block
The user can add/delete/edit the children pages.
My intention is to include content_block of all n-child pages into one partent page, as a sort of query.
I then tried to search for the help of $cgsimple->get_children.
First, trying with the example loop on documentation page of CGSimpleSmarty:
{$cgsimple->get_children('','',$children)}
{if count($children)}
{foreach from=$children item='child'}
{if $child.show_in_menu}
Child: id = {$child.id} alias = {$child.alias};
{/if}
{/foreach}
{/if}
But with no output.... then I tried a simplified form that is:
{$cgsimple->get_children('','',$child)}
{$child.id}
And even this outputs none; I used that CGSimple code on the template of parent page.
I'm sure that 'Parent' page is recognized to have children with {$cgsimple->has_children()} returning 1.
But I cannot explain this behaviour..
Where is my mistake?
Thank you in advance!
Alex (italy)