Creating a summary page

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
junito
Forum Members
Forum Members
Posts: 28
Joined: Fri Oct 27, 2006 5:07 pm

Creating a summary page

Post 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...
swathes

Re: Creating a summary page

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Creating a summary page

Post by Dr.CSS »

This would have to be done using the 'News' module at the moment...
swathes

Re: Creating a summary page

Post 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
junito
Forum Members
Forum Members
Posts: 28
Joined: Fri Oct 27, 2006 5:07 pm

Re: Creating a summary page

Post 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...
swathes

Re: Creating a summary page

Post 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!
junito
Forum Members
Forum Members
Posts: 28
Joined: Fri Oct 27, 2006 5:07 pm

Re: Creating a summary page

Post 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?
swathes

Re: Creating a summary page

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Creating a summary page

Post by Dr.CSS »

Found it, in lib\contenttypes  Content.inc.php line 242...


array_push($ret, array(lang('titleattribute').':','mTitleAttribute).'" />'));
cyberman

Re: Creating a summary page

Post by cyberman »

Thx for your search :) ...
swathes

Re: Creating a summary page

Post by swathes »

Thanks for your help Mark!  Highly appreciated!

D
swathes

Re: Creating a summary page

Post 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.
Locked

Return to “CMSMS Core”