Log in

View Full Version : Get CMS section in plugin code


alfanexus
04-11-2010, 12:36 PM
I am trying to create a Tab for a specific CMS section. For this I am creating a plugin that adds the tab.

My question: How do I check if the curent article belongs to a specific section?

Its easy to check that I am in the CMS by using if (THIS_SCRIPT == 'vbcms') but what can I use to check for the category an article belongs to? :confused: :erm: :eek:

Lynne
04-11-2010, 02:35 PM
I believe you want to look at the parentnodeid. Take a look at the table cms_node

alfanexus
04-12-2010, 10:20 AM
Thanks, but how do I get parentnodeid?

Can I test something like if ($parentnodeid == 3) ?

Lynne
04-12-2010, 02:03 PM
Since I haven't tried this, I can't tell you exactly how to do it. I just know that that is the variable you'll need. If I were to do this, I'd play with a few plugins and see what I could figure out and I'd also look in the code to see what variables are available, and more importantly, what their names are.

alfanexus
04-13-2010, 11:20 AM
I found something called $sectionid but it seems that this variable can not be used when creating a tab plugin using this method: https://vborg.vbsupport.ru/showthread.php?t=226914

Lynne
04-13-2010, 02:38 PM
As I just wrote in another thread, some templates are rendered at the beginning of the page and so page variables aren't available for use unless you do something in a plugin to make that so beforehand.