MyBB Community Forums

Full Version: Expand Collapse Forums Not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not sure where I went wrong, I haven't messed with too much in general but apparently I messed something up. The expand/collapse buttons are not working for the forums, however it is working for the statistics area so I'm super confused. Would anyone be able to point out whats going on?

Code in the forumbit_depth1_cat
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$expthead}" colspan="5">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div style="font-size: 17pt;"><a href="{$forum_url}">{$forum['name']}</a><br /><div class="smalltext">{$forum['description']}</div></div>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
<tr style="display: none;">
<td class="tcat" colspan="2"><span class="smalltext"><strong>{$lang->forumbit_forum}</strong></span></td>
<td class="tcat" width="85" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span></td>
<td class="tcat" width="85" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span></td>
<td class="tcat" width="200" align="center"><span class="smalltext"><strong>{$lang->forumbit_lastpost}</strong></span></td>
</tr>
{$sub_forums}
</tbody>
</table>
<br />

Link to my board: http://aashirya.sunwolves.com/index.php
actually it works.. when you click on the collapse button the following element..

<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">

gets a style="display: none;" property to hide/collapse it and hence hides the forums..

however in your case you have a new table in the forumbit_depth2_forum template which makes the sub forums to be not hidden as it gets moved outside the tbody mentioned above..
OOOOO! Is there something I could wrap them in to make it work again?

This is what I have in that area you've mentioned.
<table style="display: inline-block; vertical-align: top;" cellpadding="0" cellspacing="0"><tr><td>
	<div style="width: 522px;  height: 237px; overflow: hidden;">
		<div class="trow1" style="font-size: 13pt; text-transform: uppercase; padding: 5px; text-align: center;"><a href="{$forum_url}">{$forum['name']}</a></div>
		<div class="tcat" style="padding: 3px; text-align: center;"><span class="smalltext">{$lastpost}</span><br /><span class="smalltext" style="text-transform: none; opacity: 0.5;">{$threads} threads — {$posts} posts</span></div>
		<div class="trow2"><div style="height: 130px; overflow: auto;">{$forum['description']}</div></div>
		<div style="text-align: center; padding: 0px;">{$subforums}</div>
	</div>
</td></tr></table>
try removing the table and use only tr and td


<tr><td>
    <div style="width: 522px;  height: 237px; overflow: hidden;">
        <div class="trow1" style="font-size: 13pt; text-transform: uppercase; padding: 5px; text-align: center;"><a href="{$forum_url}">{$forum['name']}</a></div>
        <div class="tcat" style="padding: 3px; text-align: center;"><span class="smalltext">{$lastpost}</span><br /><span class="smalltext" style="text-transform: none; opacity: 0.5;">{$threads} threads — {$posts} posts</span></div>
        <div class="trow2"><div style="height: 130px; overflow: auto;">{$forum['description']}</div></div>
        <div style="text-align: center; padding: 0px;">{$subforums}</div>
    </div>
</td></tr>
That worked! However I came across the problem that it actually messed up the display inline block thing I had going on, so I did some tweaking in the css and now it's good to go! Thank you!!