PDA

View Full Version : how to identify CMS section?


anolian
03-20-2013, 07:55 PM
Hi

Is there a way to idenfity the CMS section to which an article belongs?

I want to write a plugin which will set a variable with different values in different sections.

Thanks, Mike

Lynne
03-20-2013, 08:52 PM
Try something like ...
hook location - vbcms_article_populate_end
global $sectionid;
$sectionid = $this->content->getParentId();
Then in set_navigation_tab_vbview:
global $sectionid;

if (intval($_GET['r']) == 2 OR in_array($sectionid, array('2','20','21'))) $root = 'tabid';

change stuff in red

anolian
03-21-2013, 08:37 PM
Thanks Lynne

haven't had a chance to try it yet but your advice always works so I'm confident!

Cheers, Mike

anolian
03-23-2013, 05:57 PM
Works a treat!

Thanks again, Lynne.