SMFHacks.com
SMF Classifieds => Support => Topic started by: exit on February 04, 2018, 12:34:04 pm
-
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?
<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>
In this example, I'm trying to get the current actions for simpleportal and for the classifieds mod.
-
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.
-
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.
I added $current_action to the global set, now it identifies the action :)
' , $current_action == 'classifieds' ? 'current' : 'not' , '
this is not retrieving 'current' though, anything wrong here?
-
I would echo the output of $current_action to see what it is returning.
-
I would echo the output of $current_action to see what it is returning.
How can I do that?
-
on it's own line
echo $current_action;
-
Thanks a lot for this reply, it has helped me too