Gaining $current_url from dynamic urls | top_menu.tpl

top_menu.tpl

Skin: Default Blue 1.3.4 Sp3



{* VIEW CART *}



{$lang.view_cart}


Can anyone explain how to ‘decode’ common URLs to smarty coding?

I need a single topic page to be classified as the $current_url in order to get the ‘pushed button’ impression on the menu.



[COLOR=black]Domain.com

{if $current_url == “$index_script?target=topic_data&topic_id=14”}



[url]Domain.com

{if $current_url == “$index.php?target=forms&name=contact_us”}



I’ve tried the following without success:

{if $current_url == “$index_script?$target=$topic_data&topic_id=14”}



Eg Click on ‘view cart’ from the top navigation menu on the cs-cart demo,

the button will then go light blue with the others being the default solid state colour.



If anyone’s got any ideas it would be much appreciated to reply :smiley:

Jesse

Jesse,



I’m not in front of my development environment right now, but why not check your debug window and see what’s being set in $current_url when you’re on that page?



B

Im not sure exactly what your trying to do, but you got variables all over the place and is confusing to me what you want.



[url]http://localhost/cscart/index.php?target=cart[/url]

produces the variable below:

[COLOR=blue]{$current_url} = [/COLOR][COLOR=green]index.php?target=cart[/COLOR]

[quote name=‘ETInteractive’]Im not sure exactly what your trying to do, but you got variables all over the place and is confusing to me what you want.



[URL=“http://localhost/cscart/index.php?target=cart”]http://localhost/cscart/index.php?target=cart[/URL]

produces the variable below:

[COLOR=blue]{$current_url} = [/COLOR][COLOR=green]index.php?target=cart[/COLOR][/quote]



That’s more or less what I required except, when the page loads the variable won’t load as it’s php, not smarty :stuck_out_tongue: I got confused beyond definition however I’ll show you all what I was aiming for. Worked too :smiley:





As you can see the red coding is what really confused the **** outta me.

And so, I needed three different URL strings to signify what page I was on when I clicked on the buttons.



{* CONTACT US *}



{$lang.contactus}


{* CONTACT US *}







{$lang.contactus}



the top one is actually working :stuck_out_tongue:

thanks for the code regardless.



It was a matter of & since html escape characters must be used in php?