Show content of page in menu item? [solved]

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
GroeneKaktus
Forum Members
Forum Members
Posts: 46
Joined: Sat Mar 06, 2010 10:38 am

Show content of page in menu item? [solved]

Post by GroeneKaktus »

Dear all

I'm trying to get the first words (or letters) of a child page to appear in my menu. So basically the Title, first part of the content of the page showes in the menu, and after that a "read more" link which is the actual link of the item. I want to avoid using the extra1, extra2 , etc, fields for this since I want to keep it simple for my editors to maintain the pages.

I tried cgsimple to dig up the content of each page in the menu, using for each menu item

Code: Select all

{$cgsimple->get_page_content('$node->alias')}
but this doesn't work, though entering 'home' for example works as a charm here. It's not possible using the node params here?

Or, is there something I overlook or should I approach this in a different way ?

Thank you very much in advance,

Best regards,

Jeroen
Last edited by GroeneKaktus on Fri Dec 28, 2012 7:21 am, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Show content of page in menu item?

Post by Jos »

You don't need quotes around variables.

Code: Select all

 {$cgsimple->get_page_content($node->alias)} 
Note that this method is a heavy attack on your database. For each menu-item the database gets queried again.
GroeneKaktus
Forum Members
Forum Members
Posts: 46
Joined: Sat Mar 06, 2010 10:38 am

Re: Show content of page in menu item?

Post by GroeneKaktus »

Thanks Jos.. shoot me ::)

As for the database load, the menu only show the two newest vacature entries in summary.

Thanks again, sometimes it's so easy to overlook.


Regards
Jeroen
Post Reply

Return to “The Lounge”