Page 1 of 1

How to get section and categorie id?

Posted: Sun Oct 28, 2007 10:33 pm
by Notausgang
Hi,
I'm trying to write a module that outputs the section and categorie name (for Joomla 1.5).

My problem is, that I don't know know how to get the section and categorie ID of the shown page.

Can someone help me?

Thank you in advance,
Tobias

Re: How to get section and categorie id?

Posted: Sat Nov 03, 2007 4:56 pm
by lobos
Do you see the id's come up in the URI / URL ? - if so you can get the id like this:


$id = mosGetParam( $_REQUEST, 'id', '' );

-Lobos

Re: How to get section and categorie id?

Posted: Sun Nov 04, 2007 2:03 pm
by Opie
lobos wrote:Do you see the id's come up in the URI / URL ? - if so you can get the id like this:


$id = mosGetParam( $_REQUEST, 'id', '' );

-Lobos
Is this the correct way for 1.5?  I thought the mos was no longer used in 1.5.

Re: How to get section and categorie id?

Posted: Sun Nov 04, 2007 5:25 pm
by lobos
Sorry I didn't know you were using 1.5... I am sure you can find out the correct function for yourself now that you understand the concept.

-Lobos

Re: How to get section and categorie id?

Posted: Sun Nov 04, 2007 6:19 pm
by Opie
I only mentioned that as the OP requested for Joomla 1.5.

Re: How to get section and categorie id?

Posted: Sun Nov 04, 2007 10:00 pm
by Notausgang
Thank you, i thought there is an easier way..

For examble, a URL can look like this:
index.php?option=com_content&view=section&layout=blog&id=5&Itemid=54
or: index.php?option=com_content&view=category&layout=blog&id=50&Itemid=80
or: index.php?view=article&catid=34:categorie_name&id=45:article_name&option=com_content&Itemid=61

So i have to watch what the "view"-parameter looks like.

But thats fine, i will get along with that.

Thanks!

Re: How to get section and categorie id?

Posted: Mon Mar 17, 2008 8:21 pm
by butterwise
If anyone has devised a method of displaying the section id or name please post the solution. Thanks...