inherit
busskohls@gmail.com
195930
0
Feb 9, 2022 10:44:07 GMT -8
Deltra
13
June 2013
leap
|
Post by Deltra on Sept 5, 2017 17:16:07 GMT -8
Hello, Proboards Support! I had a question regarding if/else statements in the layout templates. I've been doing some extensive styling on my board, enough that I've been hitting variable limits in some of them like the User Profile and the Board List templates. Now, I can work around some of these things, but ideally I wouldn't have to. My main problem (at least in regards to the board list) is that, even if I want identical styling for, say, three boards that's different from the styling for every OTHER board, I have to specify each individual board of the three and copy-paste the same HTML over for each and every one. When I'm redesigning upwards of, say, fifteen boards, some with identical HTML and others with HTML unique onto them, it becomes pretty obvious why I end up hitting my head against the variable ceiling. In short, my question (and potential life saver) is this: Is there some AND or OR statement that can be added to the standard {if ___}{/if} syntax? Something along the lines of {if $[board.name] = “BOARD 1” OR “BOARD 2”}{/if}? If not, I suppose I'll just have to do with playing footsie with that variable limit; if so, though, I'd love to know! It would help a lot down the line! Here's the site that I was having troubles on. I managed to get around that aforementioned limit at the cost of not having recent posts in most of the boards RIP, but I'm planning to start on a new skin and would like to avoid that later down the line if I can! Thanks in advance!
|
|
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 Sept 5, 2017 18:28:10 GMT -8
Yep! But you need the right syntax:
||
the two vertical lines, not Ls or i's, signify "or"
&&
signifies and (meaning ALL conditions specified must be filled)
So:
{if $[board.name] == "Board A" || $[board.name] == "Board B"}
will read "if the board name is Board A *or* Board B"
and
{if $[board.name] == "Board A" && $[board.name] == "Board B"}
will read "if the board name is Board A *and also* Board B"
^ though note if the condition is impossible to meet (e.g. a board cannot have two names simultaneously) the conditional will not execute.
|
|
inherit
busskohls@gmail.com
195930
0
Feb 9, 2022 10:44:07 GMT -8
Deltra
13
June 2013
leap
|
Post by Deltra on Sept 6, 2017 5:02:17 GMT -8
Kami, you're a literal godsend, thank you so, so, so, so much. ToT I was one symbol off when I tried figuring it out myself, RIP. I'll definitely be putting this to good use, though. It really means a lot! 8 D
|
|
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 Sept 6, 2017 7:55:32 GMT -8
You're welcome! Take care (:
|
|