inherit
163839
0
May 25, 2017 20:48:34 GMT -8
Maiden
1,020
February 2011
dreamaiden
|
Post by Maiden on Jan 28, 2013 3:41:26 GMT -8
|
|
inherit
163839
0
May 25, 2017 20:48:34 GMT -8
Maiden
1,020
February 2011
dreamaiden
|
Post by Maiden on Jan 28, 2013 16:29:30 GMT -8
*tries to look hopeful rather than impatient*
I feel like this could be an 'if/else' accomplished thing but I don't know enough about that sort of stuff :s
|
|
inherit
163839
0
May 25, 2017 20:48:34 GMT -8
Maiden
1,020
February 2011
dreamaiden
|
Post by Maiden on Jan 29, 2013 3:04:33 GMT -8
solariamock.freemessageboards.com/board/14/charactersSo it looks like it worked but it's also applied it to all the board lists if I change the first bit to ] == 14 then it applies now where. If I just have one space (regardless of which side of the == then it eats the whole subboards bit) Anyone know how to correctly target a single board? Thanks {if $[board.id]==14} <table class="list" role="grid"> <thead> <tr> <th class="main" colspan=2>Board</th> </tr> </thead> <tbody> {foreach $[board]} {if !$[board.is_redirect]} <tr id="$[board.content_id]" class="$[board.content_class]"> <td class="icon">$[board.icon]</td> <td class="main clickable"> <span class="link"><a href="$[board.href]">$[board.display_name]</a></span><br /> <p class="description">$[board.description]</p> {if $[board.num_mods]} <p class="moderators"> Moderator{if $[board.num_mods] != 1}s{/if}: {foreach $[board.moderator_group]}$[board.moderator_group.comma_before] $[board.moderator_group]{/foreach}{if $[board.moderator]}{if $[board.moderator_group]}, {/if}{/if} {foreach $[board.moderator]}$[board.moderator]$[board.moderator.comma] {/foreach} </p> {/if} {if $[board.sub_board]} <p class="sub-boards"> Sub-board{if $[board.sub_board] != 1}s{/if}: {foreach $[board.sub_board]}$[board.sub_board]$[board.sub_board.comma] {/foreach} </p> {/if} </td> </tr> {else} <tr id="$[board.content_id]" class="$[board.content_class]"> <td class="icon">$[board.icon]</td> <td class="main clickable redirect last"> <span class="link">$[board]</span><br /> <p class="description">$[board.description]</p> </td> </tr> {/if} {/foreach} </tbody> </table>
{else} <table class="list" role="grid"> <thead> <tr> <th class="icon"></th> <th class="main">Board</th> <th class="threads">Threads</th> <th class="posts">Posts</th> <th class="latest last">Last Post</th> </tr> </thead> <tbody> {foreach $[board]} {if !$[board.is_redirect]} <tr id="$[board.content_id]" class="$[board.content_class]"> <td class="icon">$[board.icon]</td> <td class="main clickable"> <span class="link"><a href="$[board.href]">$[board.display_name]</a></span><br /> <p class="description">$[board.description]</p> {if $[board.num_mods]} <p class="moderators"> Moderator{if $[board.num_mods] != 1}s{/if}: {foreach $[board.moderator_group]}$[board.moderator_group.comma_before] $[board.moderator_group]{/foreach}{if $[board.moderator]}{if $[board.moderator_group]}, {/if}{/if} {foreach $[board.moderator]}$[board.moderator]$[board.moderator.comma] {/foreach} </p> {/if} {if $[board.sub_board]} <p class="sub-boards"> Sub-board{if $[board.sub_board] != 1}s{/if}: {foreach $[board.sub_board]}$[board.sub_board]$[board.sub_board.comma] {/foreach} </p> {/if} </td> <td class="threads">{if $[board.threads] == -1}N/A{else}$[board.threads]{/if}</td> <td class="posts">{if $[board.posts] == -1}N/A{else}$[board.posts]{/if}</td> <td class="latest last"> {if $[board.posts] > 0} {if $[board.last_thread]} $[board.last_thread.recent_link]<br /> by $[board.last_thread.last_post.created_by_user]<br /> <span class="date">$[board.last_thread.last_post.date]</span> {/if} {else} No posts have been made on this board. {/if} </td> </tr> {else} <tr id="$[board.content_id]" class="$[board.content_class]"> <td class="icon">$[board.icon]</td> <td class="main clickable redirect last" colspan="4"> <span class="link">$[board]</span><br /> <p class="description">$[board.description]</p> </td> </tr> {/if} {/foreach} {if !$[board]} <tr class="last"><td class="last center" colspan="5">No boards were found.</td></tr> {/if} </tbody> </table>
|
|
inherit
163839
0
May 25, 2017 20:48:34 GMT -8
Maiden
1,020
February 2011
dreamaiden
|
Post by Maiden on Jan 30, 2013 5:33:30 GMT -8
and I tried it another way but not luck that way either.
If anyone even has any pointers that would be appreciated.
Thanks
|
|
inherit
\o/ ^o^ /o_ /o\
16464
0
Jul 22, 2024 13:57:10 GMT -8
pawl
29,621
November 2003
pollo
Pink Stars
|
Post by pawl on Jan 30, 2013 18:30:56 GMT -8
This is just a quick post to point you in the right direction, but I thought there were a couple of things worth mentioning;
{if $[board.id] == X} is the correct way. Both myself and Brian in your other thread have got it working.
Now onto the id you're using - 14 is the id of the board where the sub-boards display, no? If so, you don't want to use 14. The id you put in the {if} will be read as the individual board that's about to be displayed. If the id's of the sub-boards are 15, 16 and 17 then those are the boards you need to code in.
Unfortunately the way that the templates work, you don't have full {if} statement functionality, otherwise it would be much easier, because you could just use {if $[board.id] == 15|16|17} However, this doesn't work for us. What you'll need to do is something more like this; {if $[board.id] == 15} SOMETHING {elseif $[board.id] == 16} THE SAME SOMETHING {elseif $[board.id] == 17} THE SAME SOMETHING {else} THE SOMETHING FOR EVERYWHERE ELSE {/if}
With me so far? Good. Now, you're also adding rather a lot of code to the {if}. Not sure if this is necessarily bad, but you could cut it down a bit. I'd go through your code, but it's late and I want to go to bed soon, so I'm going to let you do the hard work. =P This bit might not make much sense, so I apologise in advance.
It would be easier, I think, to simply use the {if}'s to only change the bits that are different in your targetted sub-boards. For example, if you're getting rid of columns, you could have something like this;
<td class="description" {if thing here}colspan="3"{/if}>Board Title / Description</td>{if != thing here}<other td's go here for other boards>{/if}
See where I'm going with that? It's a little odd to read, I know. >_<
That might help a little though, but it will require a fair amount of trial and error, if your efforts are anything like mine. xD
|
|
inherit
163839
0
May 25, 2017 20:48:34 GMT -8
Maiden
1,020
February 2011
dreamaiden
|
Post by Maiden on Jan 31, 2013 3:16:59 GMT -8
Hi pawlThank you for this, it really does help my learning! The last bit does make sense as well, because duplicating the whole lot felt like a particularly gross was to do it. For this particular problem Brian provided this solution. <style type="text/css"> .container.boards .icon, .container.boards .threads, .container.boards .posts, .container.boards .latest { display: none; } </style> Which got me here solariaweyr.proboards.com/board/14/characters ('cause I put .icon back in.... now to work out width....) But I shall take your pointers on to try and tackle my next problem
|
|