inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 12, 2016 12:48:06 GMT -8
I have a custom page called "Front Page", I don't want certain aspects to show on the front page at all, but I do wish them to show on all other pages... How can I do this? memoriesofthecreed.boards.net/Brian
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Jun 12, 2016 13:29:47 GMT -8
If the element you intend to hide is something generated from the Forum Wrapper you can usually hide it using an if statement in the Forum Wrapper layout template.
But if anything is added via a code or plugin the only way to hide it is by targeting its class using CSS and giving it a display: none; property. While this hides it visually it will still render on the page, so if the element you're hiding needs to be hidden for security purposes this method probably won't suit your needs.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 12, 2016 17:41:34 GMT -8
It's a block of html. Cam you let me know how to do so via if statement
|
|
Alisha
Junior Member
Cake, and grief counseling, will be available at the conclusion of the test.
Posts: 308
inherit
174267
0
Jun 17, 2024 17:20:06 GMT -8
Alisha
Cake, and grief counseling, will be available at the conclusion of the test.
308
December 2011
alishabussart
|
Post by Alisha on Jun 12, 2016 18:20:15 GMT -8
Boy_Wonder Surrounding the block of HTML with this if statement should do the trick, if I'm not mistaken. Replace "PAGENAME" with your page name, which should be the part of the url that identifies the page. In your case, I think you might use the word "home" because you have that custom page set as the homepage or landing page of the forum. {if $[route.name] != 'PAGENAME'} HTML here {/if} This says that the block(s) of code should only appear on pages that arent your chosen page.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 12, 2016 23:26:59 GMT -8
So far its currently refusing - the page itself is called properly 'Front Page' however no variant of that or home is working (I'm trying to hide the sidebar)
Solved it - I had to use the id instead!
Or not... its working too well with Id @_@
|
|
inherit
226544
0
Oct 5, 2018 10:29:39 GMT -8
Ulises
4,881
November 2015
umacklin
Ulises Weirdo
|
Post by Ulises on Jun 13, 2016 10:11:53 GMT -8
Boy_Wonder Are you using it like so? {if $[route.params.page_id] != 'front-page'} HTML here {/if} That should work.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 13, 2016 10:20:52 GMT -8
Boy_Wonder Are you using it like so? {if $[route.params.page_id] != 'front-page'} HTML here {/if} That should work. Just tried it - its refusing to hide the sidebar off the front page without I alter it to this: {if $[route.params.page_id] ! = 'front-page'}
...which then hides it on all pages! Without the space though it refuses to hide it anywhere
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Jun 13, 2016 10:29:56 GMT -8
Since your custom page is set as your home page $[route.params.page_id] is no longer applicable.
You'll need to use this if statement instead.
|
|
inherit
226544
0
Oct 5, 2018 10:29:39 GMT -8
Ulises
4,881
November 2015
umacklin
Ulises Weirdo
|
Post by Ulises on Jun 13, 2016 10:30:42 GMT -8
Boy_Wonder Where are you adding the code? In the Forum Wrapper template or in the HTML section of the page? I was under the impression you were adding it to the latter.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 13, 2016 10:32:34 GMT -8
Brian to the rescue!!
Ulises - it was in the forum wrapper but apparently it wanted to be finicky! Bad proboards
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 20, 2016 10:55:34 GMT -8
Brian UlisesI tried to add a second page that I do not want my side-bar showing on... and its not working... have I done this right? {if $[route.name] != "front-page" || $[route.name] != "getting-started"}
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Jun 20, 2016 11:01:13 GMT -8
$[route.name] won't capture the custom page ID. You'll need to use $[route.params.page_id] for any custom pages that aren't set as your homepage.
You'll also want to use && instead of || in this case. If you use || you're telling it to run as long as any of your statements are true instead of all of them being true at once.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 20, 2016 11:07:59 GMT -8
$[route.name] won't capture the custom page ID. You'll need to use $[route.params.page_id] for any custom pages that aren't set as your homepage. You'll also want to use && instead of || in this case. If you use || you're telling it to run as long as any of your statements are true instead of all of them being true at once. Apparently I'm having REAL problems making it work... as its still saying no ¬¬ This is my updated code {if $[route.params.page_id] != "front-page" && $[route.params.page_id] =! "getting-started"}
It's still refusing to hide on this page: memoriesofthecreed.boards.net/page/getting-started
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Jun 20, 2016 11:09:00 GMT -8
You typed =! instead of != so it's not validating correctly.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 20, 2016 11:11:22 GMT -8
Apparently I can't read XD
|
|