How to get the actual category

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
Post Reply
bepposun
Posts: 16
Joined: Fri 22. Jun 2007, 17:28

How to get the actual category

Post by bepposun »

I found in the forum the way how to use pagetitle etc.
http://www.phpwcms.de/forum/viewtopic.php?t=13841

So with $GLOBALS['content']["cat_name"]; it's possible to get the category. Fine. However I try to get the name of the category above the actual level.

Example:

Level0->Level1->Level2->Level3
I'm on Level3 and try to get the name of Level2.

Looking into the db I see that I could use table phpwcms_articlecat since there is the field acat_struct which actually contains the parent category but I'm not sure how to access this data - probably there is a simple solution?

(As you can see I just start with MySQL and PHP and phpwcms ;)

Cheers Beppo
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

hi,
write print_r($GLOBALS) in your script, and you will get all available data (Titel, IDs etc.) and information about naviagtion structure ($LEVEL_ID).
You know how to read an array/structure tree?
i have someting like this in mind (the structure maybe wrong $LEVEL_ID is important - it is replaced with the right cat id in structure)

$GLOBALS['content'][$LEVEL_ID[2]]["cat_name"]

grüße
marcus
bepposun
Posts: 16
Joined: Fri 22. Jun 2007, 17:28

Post by bepposun »

Thanks, this thing print_r($GLOBALS) is really interesting.

With $GLOBALS['LEVEL_STRUCT'][3] I get the category name above the actual category (in this case).

Now I discovered that I need not the category name, but the alias. Any idea how to get this?

Regards, Joerg
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

Post Reply