Page 1 of 1
[SOLVED] How to build a summary page? (Using menu template?)
Posted: Sun Jun 23, 2013 9:04 pm
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
Re: How to build a summary page? (Using menu template?)
Posted: Mon Jun 24, 2013 10:01 am
by velden
Check the cgsimplesmarty module
http://dev.cmsmadesimple.org/projects/cgsimplesmarty
and cgsimple::get_page_content method
Re: How to build a summary page? (Using menu template?)
Posted: Tue Jun 25, 2013 8:12 pm
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
Re: How to build a summary page? (Using menu template?)
Posted: Tue Jun 25, 2013 8:23 pm
by Rolf
Re: How to build a summary page? (Using menu template?)
Posted: Tue Jun 25, 2013 8:54 pm
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
Re: How to build a summary page? (Using menu template?)
Posted: Tue Jun 25, 2013 9:10 pm
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}
Re: How to build a summary page? (Using menu template?)
Posted: Tue Jun 25, 2013 9:15 pm
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
[Solved] How to build a summary page? (Using menu template?
Posted: Fri Jul 12, 2013 11:37 am
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!