Former Member
inherit
guest@proboards.com
251770
0
Nov 22, 2024 20:15:00 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 13, 2019 20:17:22 GMT -8
I'm basically trying to add in a section to the post list that only shows up on specific boards and their sub-boards. The standard {if $[board.id] == '40'} doesn't seem to do the trick in this case. <3 Thanks in advance for the help! <3
|
|
#eb7100
33409
0
1
Nov 13, 2024 16:56:46 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 14, 2019 10:06:02 GMT -8
The template you're modifying determines what variables are available. In this case the $[board] variable doesn't exist in Themes > Layout Templates > Thread > Post List, so you have to look for something else that represents the board ID. The Post List template is used to generate posts, so it can be deduced that the most data available within the template is going to come from the variable that represents posts. With that in mind, the $[post] variable visible in the Loops and Variables sidebar is your best bet. And if you expand that variable tree you'll see... $[post.board_id] is the variable you'll want to use.
|
|
Former Member
inherit
guest@proboards.com
251770
0
Nov 22, 2024 20:15:00 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 14, 2019 20:07:52 GMT -8
Thank you, this helps a lot! I hadn't even realised it would be hidden away in there, it's so easy to miss things when you've got no idea what you're looking for. :X
edit: Is there a way to specify multiple boards in the same string, or include sub boards? I've tried:
{if $[post.board_id] == '40' == '66'}
{if $[post.board_id] == '40', '66'}
{if $[post.board_id] == '40, 66'}
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Feb 14, 2019 23:40:21 GMT -8
Thank you, this helps a lot! I hadn't even realised it would be hidden away in there, it's so easy to miss things when you've got no idea what you're looking for. :X edit: Is there a way to specify multiple boards in the same string, or include sub boards? I've tried: {if $[post.board_id] == '40' == '66'} {if $[post.board_id] == '40', '66'} {if $[post.board_id] == '40, 66'} You want to use the double pipe symbol ( || ) that represents "or" in programming language (much like the double ampersand ( && ) represents "and"). So, you'd use this: {if $[post.board_id] == 40 || $[post.board_id] == 66}
Hope that helps!
|
|
#eb7100
33409
0
1
Nov 13, 2024 16:56:46 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 15, 2019 10:02:42 GMT -8
Each post is tied to a thread, and that thread is tied to a single board so $[post.board_id] treats them the same regardless of whether they're a regular board or sub-board. The only difference a board being a sub-board makes is where it appears and what permissions it inherits from its parent category and boards. Apart from that they're exactly the same as a regular board and have a unique numerical ID just like them. That ID is output by $[post.board_id].
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Feb 15, 2019 12:39:52 GMT -8
Each post is tied to a thread, and that thread is tied to a single board so $[post.board_id] treats them the same regardless of whether they're a regular board or sub-board. The only difference a board being a sub-board makes is where it appears and what permissions it inherits from its parent category and boards. Apart from that they're exactly the same as a regular board and have a unique numerical ID just like them. That ID is output by $[post.board_id]. Just curious, Brian - but what does the $[post.thread.sub_board] return then? Is it just a Boolean return or something else? Thanks!
|
|
#eb7100
33409
0
1
Nov 13, 2024 16:56:46 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 15, 2019 12:46:55 GMT -8
Just curious, Brian - but what does the $[post.thread.sub_board] return then? Is it just a Boolean return or something else? Thanks! I dunno where you're getting that variable from. I don't see it in Thread > Post List. dev.prbrds.com/b/o/ekmQFHXqbgjwDAIlicBu.png
|
|