Kami
Forum Cat
Posts: 40,044
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,044
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on May 22, 2017 11:18:22 GMT -8
Lynx I'm not peter but 'home' and 'forum' would make sense only if they wanted the content to appear both on the landing page + forum; in the case of this thread ie changing subboard listings only, you would only need to use 'forum'.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on May 22, 2017 12:35:41 GMT -8
Lynx I'm not peter but 'home' and 'forum' would make sense only if they wanted the content to appear both on the landing page + forum; in the case of this thread ie changing subboard listings only, you would only need to use 'forum'. Typo? I think you meant to say "board"? Lynx, correct
Just to be 100% clear on what I meant in my last post, as I was in a rush so didn't explain properly. And this is useful on the JS side as well, as the routes are obviously the same. Just in case people aren't aware of the 2 route types for the home page... So we define the "home" route as the main index page of the forum usually. It's generally the first page that people see when they visit (support.proboards.com). This route with no custom page set is "home". With a custom page set, this route still becomes "home", and the main page of the forum (board listing page), becomes "forum". So the proper condition to check for only the main page (we don't care if it's a custom page usually) is a condition that matches either of them. In the case of this thread, then we can simplify the condition by only checking for the "board" route. Otherwise, if in the future a custom page is setup for the home, then the condition used just for "home" would be incorrect and no longer work as expected. {if $[route.name] == "board} // layout just for sub board listing {else} // Home / Forum route board listing {/if} Hope that was clear
|
|
Kami
Forum Cat
Posts: 40,044
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,044
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on May 22, 2017 13:08:26 GMT -8
Lynx I'm not peter but 'home' and 'forum' would make sense only if they wanted the content to appear both on the landing page + forum; in the case of this thread ie changing subboard listings only, you would only need to use 'forum'. Typo? I think you meant to say "board"? :P ._.;'
|
|
Sinity
New Member
Wait... keep waiting... just a little longer...
Posts: 10
inherit
224428
0
Jun 11, 2018 6:44:46 GMT -8
Sinity
Wait... keep waiting... just a little longer...
10
August 2015
sinity
|
Post by Sinity on May 23, 2017 15:30:01 GMT -8
{if $[route.name] == "home"} coding template for the main page boards only that will prevent this template from showing on any other page but the main page {else] coding that would default to the subboards {/if} Hope you don't mind me sticking my nose in Just a small little tip for you or others that may be unaware... The route can also be "forum" as well. In the case of the OP, it's irrelevant, as their boards are "home". Since you stuck your nose in... would there be a way to change it per board? I'm not sure I understand what a "route" is.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on May 30, 2017 3:00:06 GMT -8
Hope you don't mind me sticking my nose in Just a small little tip for you or others that may be unaware... The route can also be "forum" as well. In the case of the OP, it's irrelevant, as their boards are "home". Since you stuck your nose in... would there be a way to change it per board? I'm not sure I understand what a "route" is. Yes. You have access to the board ID in the template, so you can just match against it with the boards you want it to apply too. {if $[board.id] == 123 || $[board.id] == 456 || $[board.id] == 789} ... {/if} Each page has a different route name. This is so that plugins and templates can apply things to specific pages.
|
|