Page 1 of 1

[solved] Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 6:23 am
by Cerulean
There is a staff profiles section on a site I am developing. As well as the separate profile page for each staff member, my client wants "summary profiles" on the section landing page, showing a photo, phone number, a few other details, and a link through to the full profile.

I'd like to be able to automate the generation of the summary profiles so they are automatically updated when a staff profile page is created or deleted.

So I'm wondering if it's possible to use a MenuManager template to pull in page content from sub-pages in the Staff section. Maybe set up a second content block on each page with the summary details and then get that content block in the MenuManager template. But the MenuManager help doesn't mention such a thing so I'm thinking it probably isn't possible.

I know there are other possibilities such as using the "Extra" fields in Page Options, or making the staff profiles News articles and using a summary template, but I thought I'd ask first in case anyone has a solution (UDT maybe) for getting specified content blocks from all pages in a part of the site hierarchy.

Re: Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 5:30 pm
by Dr.CSS
Try using Company Directory, I renamed it once to Staff Directory for someone...

Re: Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 5:51 pm
by Wishbone
Yes.. Use CGSimpleSmarty. There's a function you can use to get page content.

Re: Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 8:17 pm
by Cerulean
@Dr.CSS - Thanks for the tip. I will try Wishbone's suggestion first, as I think it will be more intuitive for the client to edit staff profiles in the Pages section rather than breaking them off into the separate Company Directory section in the admin.

@Wishbone - that is perfect!
For anyone wanting to do the same, the code I used in the MenuManager template was:
{capture assign='thealias'}{$node->alias}{/capture}
{$cgsimple->get_page_content($thealias,'summary-block')}

Re: [solved] Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 10:23 pm
by Wishbone
Or even better:

{$cgsimple->get_page_content($node->alias,'summary-block')}

Re: [solved] Possible to get page content with MenuManager?

Posted: Tue Feb 21, 2012 11:06 pm
by Cerulean
Didn't realise they could be combined like that. Nice.