get current category id

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2008, 06:18 PM
mrgekko's Avatar
New Pligger
 
Join Date: Jul 2008
Posts: 6
Edit:
"Moved" this thread to the general help forums instead:

http://forums.pligg.com/general-help...light=category

Is there a way to get the current category id?

--------------------------------------
Why?
--------------------------------------
I want to put the categories in a menu list, with a class "current" if the category is the current category. Something like the following:

<li class="{if $request_category eq $cat_array[thecat].name}current{/if}">
<a href="{$URL_maincategory, $cat_array[thecat].safename}">
<span>{$cat_array[thecat].name}</span>
</a>
</li>

--------------------------------------
The problem
--------------------------------------
When dealing with non-english characters there appears to be no name when looping through the categories array that corresponds to $request_category. An example of this would be a category named "Tjänster" (means "Services" in Swedish). The following output comes for this category:

$request_category -> Tj&auml;nster

$cat_array[thecat].name -> Tjänster

$cat_array[thecat].safename -> Tj_auml%3Bnster

Thus, I can't use $request_category eq $cat_array[thecat].name}, because this will never be true (nor will $request_category eq $cat_array[thecat].safename}).

--------------------------------------
Possible solution
--------------------------------------
If I can get the current category in some way, I could compare this to $cat_array[thecat].auto_id. But I have no idea how to get the current category id, if at all possible.

Any ideas?

Cheers,
Erik

Last edited by mrgekko; 08-03-2008 at 02:17 PM. Reason: Moved to general help
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control of meta description - categories Divisive Cotton Questions and Comments 65 11-06-2009 07:10 PM
Pligg Categories Yankidank Wiki Articles 1 12-17-2008 10:10 AM
How to show category keywords as text on the site? gnalkit Questions and Comments 4 11-26-2008 05:17 AM
get current category id mrgekko Questions and Comments 6 09-11-2008 10:58 AM
Checking for the current category Rob472 Questions and Comments 2 10-10-2007 02:04 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development