L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Jul 21, 2021 16:43:09 GMT -8
Hi!
I want to execute html when the user is at certain boards. The following code executes html when the user is at any board but i don't know how to look for certain boards. Is there a way to do this?
{if $[route.name] == "board"} {/if}
Thanks, Leo.
|
|
inherit
219308
0
Feb 26, 2023 13:40:42 GMT -8
{ breezes }
12
March 2015
snowykcnomre
|
Post by { breezes } on Jul 21, 2021 22:17:28 GMT -8
board.id or board.name sounds like it would work w/ what you want.
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Jul 21, 2021 22:51:41 GMT -8
Hi L3010 and { breezes }The board id would be a far more accurate way of doing it than the board name. {if $[board.id] =="xxx"} html here {/if} xxx - replace with board id that you want to trigger the html. Note if you want more than one board then use the following. {if $[board.id] =="xxx" || $[board.id] =="yyy"} html here {/if} yyy - replace with other board id that you want to trigger the html. || = or - as in board X or board Y
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 22, 2021 7:54:53 GMT -8
For what it's worth, you should use the route method if you don't have a particular board / thread / user you want to effect but still want to affect a different page on your forum (eg: $[route.name] == 'Home').
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Aug 5, 2021 23:51:35 GMT -8
Hi! Thanks for the help.
Is there a way to check for an entire category similar to checking for a board?
like: IF current category == "music"
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Aug 7, 2021 2:18:37 GMT -8
Don't think that is an option L3010, in what way are you wanting to use it, since all catergories are visible on the home page, (depending on number and size of moniter)??
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Aug 7, 2021 3:35:51 GMT -8
This is my idea, different background colors and grid colors for each category. Nscalerr Attachments:
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Aug 7, 2021 3:38:20 GMT -8
I've figured out how to change the colors at Home, but inside each category i'm still figuring out.
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Aug 7, 2021 5:24:07 GMT -8
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 7, 2021 11:02:24 GMT -8
I've figured out how to change the colors at Home, but inside each category i'm still figuring out. If you have access to the $[board] variable and its id property then you should also have access to the category_id property of that variable which would give you in a similar fashion the id of the category in which that board is located: {if $[board.category_id] == 2}<style>body{background-color:mistyrose;}</style>{/if}TIP:The Loops and Variables tree on the right typically has all * the info you would need to determine the variables available for the currently displayed template. In a board template you would have access to $[board.category_id] and can simply double-click on the category_id property to have the variable inserted into the template at the point you were typing. In the next level down such as the thread template you can use that variable tree to drill down and come up with $[thread.board.category_id] which would give you the same functionality on the thread level
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Aug 7, 2021 12:27:49 GMT -8
Chris Thanks for the examples and thanks for telling me about the variable tree!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 7, 2021 12:55:16 GMT -8
Chris Thanks for the examples and thanks for telling me about the variable tree! You're welcome Addendum: If you are unsure how to get the numeric ID of the category use your navigation bar dropdown and click * directly on the category then look at the url for the number (e.g. "#category- 32") Click on "ProBoards Development" to get category id for that category Define:buttload
|
|