List all sub-pages title and content in one page

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Saulo Padilha
Forum Members
Forum Members
Posts: 17
Joined: Wed Jan 30, 2008 12:59 pm
Location: Juiz de Fora - MG, Brazil

List all sub-pages title and content in one page

Post by Saulo Padilha »

I want to do is something like this:

My pages structure is:

1 - Home
2 - Employees
2.1 - Bob
2.2 - Paul
2.3 - John

etc ..

What I want is that page "Employees" shows all the names and description of the Employees.

the page "Employees" HTML would be like this:

Bob
Bob works on "X" since bla bla bla ...

Paul
Paul is a engineers that bla bla bla

John
John doesn't do anything bla bla bla ...


In other words, a list of sub-pages:

{sub-page1 title}
{sub-page1 content

{sub-page2 title}
{sub-page2 content

{sub-page3 title}
{sub-page3 content

I could use the {menu ...} tag if it also list the {content} attribute, but it doesn't.

I guess that I have to use a structure like:

{foreach item=current from=contents}

{title}
{content

{/foreach}


Does anybody know how to do that ???

sorry about my english.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: List all sub-pages title and content in one page

Post by calguy1000 »

You'll need the get_page_content method from the cgsimplesmarty module, and a new menu template.
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.
Saulo Padilha
Forum Members
Forum Members
Posts: 17
Joined: Wed Jan 30, 2008 12:59 pm
Location: Juiz de Fora - MG, Brazil

Re: List all sub-pages title and content in one page

Post by Saulo Padilha »

Many thanks Calguy !! I installed the cgsimplesmarty module and create a menu template like this:

{if $count > 0}

{foreach from=$nodelist item=node}

  {$cgsimple->get_page_title($node->alias)}
  {$cgsimple->get_page_content($node->alias)}

{/foreach}

{/if}


on "Employee" page I use " {cms_module module="menumanager" template="listar_conteudo" start_level="2"} "


It works perfect !!!!!

BIG THANKS !
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: List all sub-pages title and content in one page

Post by nicmare »

this works nearly perfect! thanks!

but can i somehow sort the "menu"? now they appear in the order represented by the order of the pages in the admin menu. but i want them to be ordered by a specific content block. i have a block (rating) which contains numbers 1-10 (for a rating). and now i want to sort it, starting with the highest number:

{menu template="summary" childrenof="reviews" sortby="result" limit="10"}

AND i want to display just 10 items out of 25 items…
Post Reply

Return to “Developers Discussion”