|
Forum > Support
custom menu detecting the current action
(1/2) > >>
exit:
So, I'm trying to build a menu, not using smf menus. Basically I'm trying to get the active action, but with no luck. What am I doing wrong?
--- Code: ---<li> <a class="' , $current_action == 'SPortal' ? 'active' : 'not-active' , '" href="' , $scripturl , '">Home</a> </li> <li> <a class="' , $current_action == 'classifieds' ? 'active' : 'not-active' , '"href="' , $scripturl , '?action=classifieds">Marketplace</a> </li> --- End code ---
In this example, I'm trying to get the current actions for simpleportal and for the classifieds mod.
SMFHacks:
Is $current_action a global set in the same function you are in? You can also do with $_REQUEST['action'] to check the action name.
exit:
--- Quote from: SMFHacks on February 04, 2018, 12:54:44 pm ---Is $current_action a global set in the same function you are in? You can also do with $_REQUEST['action'] to check the action name.
--- End quote ---
I added $current_action to the global set, now it identifies the action :)
--- Code: ---' , $current_action == 'classifieds' ? 'current' : 'not' , ' --- End code ---
this is not retrieving 'current' though, anything wrong here?
SMFHacks:
I would echo the output of $current_action to see what it is returning.
exit:
--- Quote from: SMFHacks on February 04, 2018, 01:13:17 pm ---I would echo the output of $current_action to see what it is returning.
--- End quote ---
How can I do that?
Navigation
[0] Message Index
[#] Next page |
Please Help!
by SMFHacks
April 17, 2024, 08:04:55 am
|
Rate own images
by fvlog19
April 11, 2024, 10:56:53 am
|
Tidy Child Boards on 2.1.4
by SMFHacks
April 04, 2024, 03:54:12 pm
|
Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header
by Michel68
March 30, 2024, 12:41:08 pm
|
Can't DROP 'id_member'; check that column/key exists Datei:
by SMFHacks
March 30, 2024, 11:58:20 am
|
No thumbnails on new uploads
by Tonyvic
March 29, 2024, 06:26:18 am
|
Display the Contact Page for guests
by SMFHacks
March 27, 2024, 10:55:43 am
|
is it possible to add support for odysee.com
by fvlog19
March 21, 2024, 08:47:51 am
|
Request for admin notification
by davejo
March 10, 2024, 01:31:59 am
|
I need help with torrent upload
by Ineedsmfhelp
March 09, 2024, 10:01:13 pm
|
|
|