Page 1 of 1
Creating a summary page
Posted: Wed Nov 15, 2006 11:04 am
by junito
Hi
I'm wondering wether - and how - it is possible to create a section page which would include a summary of all children pages (in the main area of the page).
For example, if would like to display a link and the first 100 caracters of the first content block for every children page...
For that I think I would need a smarty tag to get access to content blocks related to page's alias and don't have any idea to do that...
Re: Creating a summary page
Posted: Wed Nov 15, 2006 10:27 pm
by swathes
hi junito,
I've touted the idea for something similar. I need to use this type of setup on my site, like this page:
http://www.chinese-in-china/centres/
I've asked one of the regulars about this, so hopefully a solution will be posted soon
Re: Creating a summary page
Posted: Thu Nov 16, 2006 6:19 am
by Dr.CSS
This would have to be done using the 'News' module at the moment...
Re: Creating a summary page
Posted: Thu Nov 16, 2006 9:14 am
by swathes
But if I didnt want to use the News module, would it be possible ? If so, where would I start? Please point me in the right direction
Re: Creating a summary page
Posted: Thu Nov 16, 2006 3:34 pm
by junito
I'm currently looking at Menu Manager module to do this ... I'm not far away but still have problems with parent/children pages...
Re: Creating a summary page
Posted: Thu Nov 16, 2006 3:41 pm
by swathes
The only other option, which I am looking at on another thread, is to use the description field. An example is shown in the documentation. However, there is a character limit...
Keep us posted with how you get on!
Re: Creating a summary page
Posted: Fri Nov 17, 2006 10:56 am
by junito
Here we go:
Create a new template called "childpages" in the Menu Manager with the following code:
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->current == true}
{* depth of the current page to find out parent *}
{assign var="current_depth" value=$node->depth}
{/if}
{/foreach}
{foreach from=$nodelist item=node}
{if $node->depth == $current_depth+1}
{* display next level pages with link and description*}
url}" title="{$node->menutext}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}{if $node->titleattribute != ''}{$node->titleattribute}{/if}
{/if}
{/foreach}
{/if}
In your page template, call the menu function this way :
{cms_module module='menumanager' template='childpages' start_level='2' collapse='1'}
I've set the start_level parameter to 2 cause I only want child pages to be displayed from level 2 pages.
Sounds good?
Re: Creating a summary page
Posted: Fri Nov 17, 2006 12:24 pm
by swathes
Yep, thats a good solution - thats what I would like to use.
However, another problem is that the titleattribute field is set to maxlength 255.
It would be good to know how to remove this. I've looked through the templates, but cant see anything
Re: Creating a summary page
Posted: Fri Nov 17, 2006 7:06 pm
by Dr.CSS
Found it, in lib\contenttypes Content.inc.php line 242...
array_push($ret, array(lang('titleattribute').':','mTitleAttribute).'" />'));
Re: Creating a summary page
Posted: Sat Nov 18, 2006 8:47 am
by cyberman
Thx for your search

...
Re: Creating a summary page
Posted: Sat Nov 18, 2006 6:19 pm
by swathes
Thanks for your help Mark! Highly appreciated!
D
Re: Creating a summary page
Posted: Sat Nov 18, 2006 6:42 pm
by swathes
The combination of the menu template posted above, and the fudging of the titleattribute field has all come together nicely! Thanks to all involved.