Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

hide item on specific page

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
prim3geek
Smarty Rookie


Joined: 01 Nov 2011
Posts: 5

PostPosted: Tue Nov 01, 2011 6:43 am    Post subject: hide item on specific page Reply with quote

What i wanna do is hide something on a specific custom page, example i have a custom page named plans.tpl so inorder for me to browse to that page i use this url

http://mywebsite.com/?a=cust&page=plans

now i want to hide a text whenever the user browse in this page so this is the code

{if $frm.a == 'cust&page=plans'}
hide me
{/if}

i also tried instead of cust&page=plans i use cust&page=plans but doesnt work i also tried using cust%26page%3Dplans

But it still shows. Any help? i think there is something to do with the ampersand sign or the equal sign
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Nov 01, 2011 12:07 pm    Post subject: Reply with quote

Dump waht you have assigned to $frm.

I suspect that $frm.a contains 'cust'
and that $frm.page contains 'plans'
Back to top
View user's profile Send private message
prim3geek
Smarty Rookie


Joined: 01 Nov 2011
Posts: 5

PostPosted: Tue Nov 01, 2011 4:26 pm    Post subject: Reply with quote

ok im really new to this smarty thing.. can you pls be more specific? really appreciate the reply Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Nov 01, 2011 10:00 pm    Post subject: Reply with quote

What do you get as output on
{$frm.a} and {$frm.page}?

I think you have the page name in $frm.page and not in $frm.a....
Back to top
View user's profile Send private message
prim3geek
Smarty Rookie


Joined: 01 Nov 2011
Posts: 5

PostPosted: Wed Nov 02, 2011 1:39 am    Post subject: Reply with quote

oh i see i get .. Very Happy i just replaced frm.a into frm.page

hmm anyone could tell me pls where i can study this thing? i have an ebook of smarty but im not sure where to look for it, tried on conditional statement but nothing on which category does it fall?

thanks a lot
Back to top
View user's profile Send private message
prim3geek
Smarty Rookie


Joined: 01 Nov 2011
Posts: 5

PostPosted: Wed Nov 02, 2011 8:16 am    Post subject: Reply with quote

ok i tried the solution above and applied it on my css style, i have 2 list and i only want to apply a class on each list on a specific page so this is what i did.

Code:
<li {if $frm.a == 'article'}class="current"{/if}>
<a href="?a=article">Articles</a>
</li>

<li {if $frm.type == 'sports'}class="current"{/if}>
<a href="?a=article&category=sports">Sports</a>
</li>


The code seems to work but whenever i go to sports page the class applies on both lists Sad
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP