inherit
188628
0
Nov 11, 2022 11:51:03 GMT -8
Molly Jepson
300
January 2013
mjdelancy
|
Post by Molly Jepson on Feb 6, 2019 6:53:32 GMT -8
Is there a way to code the boards list so that only one specific category displays its list of sub-boards on the main page?
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,521
August 2015
socalso
|
Post by Scott on Feb 6, 2019 13:44:25 GMT -8
Molly Jepson , 1. Go to Admin > Structure > Layout Templates. Make sure the correct theme is selected under 'current theme'. 2. Then go to Board > Board List tab. 3. Find this section of code: {if $[board.sub_board]} <p class="sub-boards"> Sub-board{if $[board.sub_board] != 1}s{/if}: {foreach $[board.sub_board]}<a href="$[board.sub_board.href]">$[board.sub_board.name]</a>$[board.sub_board.comma] {/foreach} </p> {/if} 4. On a new line right above that first line add this: {if $[board.category_id] == 1} Change the 1 to the number of the category you wish to have the sub-board list displayed. 5. The after the last {/if} from the code in step 3 add this on a new line: {/if} 6. The finished results should look like: {if $[board.category_id] == 1} {if $[board.sub_board]} <p class="sub-boards"> Sub-board{if $[board.sub_board] != 1}s{/if}: {foreach $[board.sub_board]}<a href="$[board.sub_board.href]">$[board.sub_board.name]</a>$[board.sub_board.comma] {/foreach} </p> {/if} {/if} Tip: An easy way to find the category ID is go to Structure > Headers & Footers. When you hover over the category, in the lower left corner of the window is the URL to the category. That last number is the ID. (Same for boards.)
|
|
inherit
188628
0
Nov 11, 2022 11:51:03 GMT -8
Molly Jepson
300
January 2013
mjdelancy
|
Post by Molly Jepson on Feb 6, 2019 14:57:20 GMT -8
Thank you very much, Scott! I had the right idea with an {if} statement but could not figure out how to identify the category. Thanks again!
|
|