How to get section and categorie id?

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
Notausgang
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Oct 28, 2007 10:28 pm

How to get section and categorie id?

Post by Notausgang » Sun Oct 28, 2007 10:33 pm

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

User avatar
lobos
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Wed Jul 19, 2006 3:33 pm
Location: Sao Paulo, Brasil
Contact:

Re: How to get section and categorie id?

Post by lobos » Sat Nov 03, 2007 4:56 pm

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
Respect and honour, sempre isso, the tribal way, the only way.
http://en.wikipedia.org/wiki/Tribes_Vengeance

Opie
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Thu Jun 22, 2006 7:32 pm
Contact:

Re: How to get section and categorie id?

Post by Opie » Sun Nov 04, 2007 2:03 pm

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.
http://springhillalumni.org • Springhill High School Alumni Association

User avatar
lobos
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Wed Jul 19, 2006 3:33 pm
Location: Sao Paulo, Brasil
Contact:

Re: How to get section and categorie id?

Post by lobos » Sun Nov 04, 2007 5:25 pm

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
Respect and honour, sempre isso, the tribal way, the only way.
http://en.wikipedia.org/wiki/Tribes_Vengeance

Opie
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Thu Jun 22, 2006 7:32 pm
Contact:

Re: How to get section and categorie id?

Post by Opie » Sun Nov 04, 2007 6:19 pm

I only mentioned that as the OP requested for Joomla 1.5.
http://springhillalumni.org • Springhill High School Alumni Association

Notausgang
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Oct 28, 2007 10:28 pm

Re: How to get section and categorie id?

Post by Notausgang » Sun Nov 04, 2007 10:00 pm

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!

butterwise

Re: How to get section and categorie id?

Post by butterwise » Mon Mar 17, 2008 8:21 pm

If anyone has devised a method of displaying the section id or name please post the solution. Thanks...


Post Reply