Creating a summary page
Creating a summary page
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...
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...
-
swathes
Re: Creating a summary page
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
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
This would have to be done using the 'News' module at the moment...
-
swathes
Re: Creating a summary page
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
I'm currently looking at Menu Manager module to do this ... I'm not far away but still have problems with parent/children pages...
-
swathes
Re: Creating a summary page
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!
Keep us posted with how you get on!
Re: Creating a summary page
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?
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?
-
swathes
Re: Creating a summary page
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
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
Found it, in lib\contenttypes Content.inc.php line 242...
array_push($ret, array(lang('titleattribute').':','mTitleAttribute).'" />'));
array_push($ret, array(lang('titleattribute').':','mTitleAttribute).'" />'));
-
swathes
Re: Creating a summary page
The combination of the menu template posted above, and the fudging of the titleattribute field has all come together nicely! Thanks to all involved.


