Page 1 of 1

Show content of page in menu item? [solved]

Posted: Thu Dec 27, 2012 11:13 pm
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

Re: Show content of page in menu item?

Posted: Fri Dec 28, 2012 4:25 am
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.

Re: Show content of page in menu item?

Posted: Fri Dec 28, 2012 7:20 am
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