PDA

View Full Version : Making Subforums Collapsible


QtrCafe
07-16-2009, 12:19 PM
Hello All,

In my previous thread (http://www.thevbgeek.com/showthread.php?t=5197) I was trying to figure a way to get the navigation system I would like to have. Well now I am encountering another issue where I have so many subforums of subforums and will be creating even more. Most probably 500+ hence I would like to use the collapsible boxes in order to get things looking neat :)

I have tried using the below code however the code will only work on the first category. If I click in the last category the effect will take place for the first as well. I think the code is not picking up all the categories IDs. I would appreciate it if someone could help.

Here is the code that I am using for GARS_forumbit_level1_post

<tbody>
<tr>
<td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>">
<a style="float:$stylevar[left]" href="#top" onclick="return toggle_collapse('forumbit_$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>
<if condition="$childforumbits">
<tbody id="collapseobj_forumbit_$forumid" style="{$collapseobj_forumid}; display:none">
<tr>
<td>
$childforumbits
</td>
</tr>
</tbody>
</if>
</tbody>

Regards,
Omar :)

QtrCafe
07-19-2009, 08:43 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