[SOLVED] How to build a summary page? (Using menu template?)

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Robert
Forum Members
Forum Members
Posts: 15
Joined: Fri Jun 21, 2013 8:38 pm

[SOLVED] How to build a summary page? (Using menu template?)

Post by Robert »

Hi,

I am looking for a way to build a summary page, does anybody know how to do this?

What I want to achieve is a page that displays clickable 'summary' content blocks from child pages. I am building a menu template for this, but I do not know how to access the 'summary' content blocks of the child pages from within the menu template.

I am sure this has been done in the past, but I cannot seem to find the answer.
Does anyone have an example of this, or a link to documentation about this?

Thanks,

--Robert
Last edited by Robert on Fri Jul 12, 2013 11:38 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: How to build a summary page? (Using menu template?)

Post by velden »

Check the cgsimplesmarty module http://dev.cmsmadesimple.org/projects/cgsimplesmarty

and cgsimple::get_page_content method
Robert
Forum Members
Forum Members
Posts: 15
Joined: Fri Jun 21, 2013 8:38 pm

Re: How to build a summary page? (Using menu template?)

Post by Robert »

Hi,

This is exactly what I was looking for, thanks! This will solve my problem.

I have been looking for information on CMSMS and useful modules/tag/tips and tricks, but I find it very hard to pick the relevant information from all the stuff on the net or this forum. I have been struggling along with CMSMS, this is my 6th CMSMS site. I really like the product, but I find it very hard to find this kind of information.
Any tips on places to find good information, or in depth tutorials? Is there a place where modules are rated on general usefulness?

-- Robert
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: How to build a summary page? (Using menu template?)

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Robert
Forum Members
Forum Members
Posts: 15
Joined: Fri Jun 21, 2013 8:38 pm

Re: How to build a summary page? (Using menu template?)

Post by Robert »

Thanks, good info!

Related to my previous question:

I want my editors to manage the 'summary' text and the real page content in one place, when editing the page.
My idea is to use a block 'summary' next to the content block. But I rather not show the summary block on the page, just use it on the summary page.

If I am not mistaken, the only way to add a 'summary' block, is to add it to the template.
But if I add it to the template, I will see it on the page.
Is there a way to have define an extra content block, without having to hide displaying this block using CSS? (I find this convoluted...)

-- Robert
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to build a summary page? (Using menu template?)

Post by calguy1000 »

In your child pages, you could use a template with something like:

Code: Select all

</__body>...
{content block='summary' wysiwyg='false' assign='junk'}{* wont be displayed when page is rendered *}
{content}
....<__body>
In your parent page you can do something like (untested)

Code: Select all

{menu childrenof=$page_alias number_of_levels=1 assign='junk'}
{foreach from=$nodelist item='node'}
  <fieldset>
     <legend>{cms_selflink page=$node->alias}</legend>
     <div>{cgsimple::get_page_content($node->alias,'summary','tmp')}</div>   
  </fieldset>
{/foreach}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: How to build a summary page? (Using menu template?)

Post by Rolf »

Robert wrote:My idea is to use a block 'summary' next to the content block. But I rather not show the summary block on the page, just use it on the summary page.

If I am not mistaken, the only way to add a 'summary' block, is to add it to the template.
But if I add it to the template, I will see it on the page.
Is there a way to have define an extra content block, without having to hide displaying this block using CSS? (I find this convoluted...)
you can use smarty, look into this example http://docs.cmsmadesimple.org/layout/ex ... e-template
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Robert
Forum Members
Forum Members
Posts: 15
Joined: Fri Jun 21, 2013 8:38 pm

[Solved] How to build a summary page? (Using menu template?

Post by Robert »

Hi,

calguy1000 provided the solution. His untested piece of code below does the trick, only one small thing missing: an eval of the result.

Code: Select all

	{menu childrenof=$page_alias number_of_levels=1 assign='junk'}
	{foreach from=$nodelist item='node'}
	  <fieldset>
	     <legend>{cms_selflink page=$node->alias}</legend>
	     <div>{cgsimple::get_page_content($node->alias,'summary','tmp')}{eval var=$tmp}</div>   
	  </fieldset>
	{/foreach}
Thanks!
Post Reply

Return to “The Lounge”