inherit
114253
0
Apr 1, 2024 6:38:35 GMT -8
Teg
Can't Wait for V6
3,138
November 2007
teg
|
Post by Teg on Oct 9, 2015 11:32:38 GMT -8
Forum URL: zimmpb.proboards.comAlright, so what I'm trying to do is apply a style to a selected <li> if the person is on that page.. However, I'm using a custom page as the "/" (home page), and I can't figure out how to select that in the if/else statement... I've tried it a few different ways and I'm stuck. {if $[route.params] == "/"} <li class="zimm_nav current"><a href="/" title="Home">Welcome</a></li> {else} <li><a href="/" title="Home">Welcome</a></li> {/if} *Note: It works if I leave as a page and not the home page with the following code:{if $[route.params.page_id] == "home"} <li class="zimm_nav current"><a href="/" title="Home">Welcome</a></li> {else} <li><a href="/" title="Home">Welcome</a></li> {/if}
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Oct 9, 2015 11:45:53 GMT -8
You probably want the $[route.name] variable. If you put this after the body tag in the forum wrapper template: {if $[current_user.id]==1} $[route.name] {/if} You'll get text in the top left corner of every page telling you what the route name is. I've done this on my forum so I can mess about with stuff and noone else can see it.
|
|
inherit
114253
0
Apr 1, 2024 6:38:35 GMT -8
Teg
Can't Wait for V6
3,138
November 2007
teg
|
Post by Teg on Oct 9, 2015 12:03:30 GMT -8
You probably want the $[route.name] variable. If you put this after the body tag in the forum wrapper template: {if $[current_user.id]==1} $[route.name] {/if} You'll get text in the top left corner of every page telling you what the route name is. I've done this on my forum so I can mess about with stuff and noone else can see it. Wow... I hate myself right now... I don't even know why I didn't think of that.. Thanks so much
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Oct 9, 2015 12:35:05 GMT -8
You probably want the $[route.name] variable. If you put this after the body tag in the forum wrapper template: {if $[current_user.id]==1} $[route.name] {/if} You'll get text in the top left corner of every page telling you what the route name is. I've done this on my forum so I can mess about with stuff and noone else can see it. Wow... I hate myself right now... I don't even know why I didn't think of that.. Thanks so much You're always very welcome! It's the little things that get us sometimes Once I spent several weeks (yes weeks!) trying to get a simple side table arrangement to chooch. Turned out I hadn't closed one of the table tags in my infocenter remodel. One missing forward slash. Weeks of work. Stay awesome, doll face, no self hatin'!
|
|