PDA

View Full Version : How to collapse subforums?


Omar Al-Ansari
07-16-2009, 07:34 AM
Hello All,

I have been trying to get the subforum to be collapsible however I could not get it to work.

I would appreciate the help

here is what I have used in the forumhome_forumbit_level1_post template

<tbody>
<tr>
<td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>">
<if condition="$childforumbits">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
</if>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
<tr>
<if condition="$childforumbits">
<td id="collapseobj_forumbit_$forumid" style="{$collapseobj_$forumid}; display:none">
$childforumbits
</td>
</if>
</tr>
</tbody>

However this code will only make the first forum to be collapsible and if I click in another forum it will also collapse the first forum.

I would appreciate the help

Regards,
Omer

Omar Al-Ansari
07-17-2009, 10:21 PM
would appreciate the help?

Omar Al-Ansari
07-19-2009, 06:39 AM
I got it

if anyone is interested then here it is

<div class="tcat">
<if condition="$childforumbits">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forum[forumid]')"><img id="collapseimg_forumbit_$forum[forumid]" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forum[forumid]}.gif" alt="" border="0" /></a>
</if>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
<if condition="$show['forumdescription']"><span class="smallfont"> &raquo; $forum[description]</span></if>
<if condition="$show['subforums']"><span class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</div>
<div class="border_left_top"<if condition="!$show['collapsable_forums']"> id="collapseobj_forumbit_$forum[forumid]" style="{$collapseobj_forum[forumid]}"</if>>
<if condition="$childforumbits">
$childforumbits
</if>
</div>

thanks to the guys at vbcodex.com