Query current section id or category

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
cacimar
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sun Aug 28, 2005 10:29 pm
Location: Austin, TX
Contact:

Query current section id or category

Post by cacimar » Wed Jan 30, 2008 4:15 pm

How can I query the section id for the article which is showing?

I'd like to show a different banner based on the section (which is a different city)
Last edited by cacimar on Wed Jan 30, 2008 10:46 pm, edited 1 time in total.
--
Rich Vázquez, CISA, CISSP
ImpactNews.com -- soon to be Joomla!

User avatar
cacimar
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sun Aug 28, 2005 10:29 pm
Location: Austin, TX
Contact:

Re: Query current section id or category

Post by cacimar » Wed Jan 30, 2008 10:46 pm

ok .. fine  :P

Figured it out.

It can be reference through:

JSite::getMenu()->getActive()->query["id"]


I'm already using a variation of "Determining if you're on the front page":
http://dev.joomla.org/component/option, ... ront_page/

Because of that, I already have a variable present:
$menu = & JSite::getMenu()

So, I call
$menu->getActive()->query["id"]


A lot of this was figured out by using:

print_r(JSite::getMenu()->getActive())



I'm going to look at variations of that and have it display when I have debug on..
--
Rich Vázquez, CISA, CISSP
ImpactNews.com -- soon to be Joomla!


Post Reply