Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

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
Thanks: 0
Thanked 0 Times in 0 Posts
get current category id

Edit:
"Moved" this thread to the general help forums instead:

get current category id

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
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Control of meta description - categories Divisive Cotton Suggestions 64 11-23-2008 07:37 PM
get current category id mrgekko General Help 6 09-11-2008 10:58 AM
Category Layout Geoserv General Help 1 02-11-2008 10:08 PM
Checking for the current category Rob472 General Help 2 10-10-2007 02:04 PM
How to get the current category johnsmith General Help 3 03-07-2007 07:39 PM


Search Engine Friendly URLs by vBSEO 3.2.0