|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
prim3geek Smarty Rookie
Joined: 01 Nov 2011 Posts: 5
|
Posted: Tue Nov 01, 2011 6:43 am Post subject: hide item on specific page |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Nov 01, 2011 12:07 pm Post subject: |
|
|
Dump waht you have assigned to $frm.
I suspect that $frm.a contains 'cust'
and that $frm.page contains 'plans' |
|
Back to top |
|
prim3geek Smarty Rookie
Joined: 01 Nov 2011 Posts: 5
|
Posted: Tue Nov 01, 2011 4:26 pm Post subject: |
|
|
ok im really new to this smarty thing.. can you pls be more specific? really appreciate the reply |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Nov 01, 2011 10:00 pm Post subject: |
|
|
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 |
|
prim3geek Smarty Rookie
Joined: 01 Nov 2011 Posts: 5
|
Posted: Wed Nov 02, 2011 1:39 am Post subject: |
|
|
oh i see i get .. 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 |
|
prim3geek Smarty Rookie
Joined: 01 Nov 2011 Posts: 5
|
Posted: Wed Nov 02, 2011 8:16 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|
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
|