MyBB Community Forums

Full Version: New Entire Collapsible Block
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Since my first thread about this was totally forgotten, I want to ask it again.

How to make a new custom, collapsible block in UserCP?
Sorry your first thread was "forgotten". Chances are the people who read it didn't know the best way to answer your question.

In the usercp_nav template (in User CP Templates), you can do this. After {$usercpmenu}, paste this:

<tr>
	<td class="tcat">
		<div class="expcolimage"><img src="images/collapse{$collapsedimg['usercpnewmenu']}.gif" id="usercpnewmenu_img" class="expander" alt="[-]" title="[-]" /></div>
		<div><span class="smalltext"><strong>Miscellaneous</strong></span></div>
	</td>
</tr>
<tbody style="{$collapsed['usercpnewmenu_e']}" id="usercpnewmenu_e">
	<tr><td class="trow1 smalltext"><a href="usercp.php?action=usergroups" class="usercp_nav_item usercp_nav_usergroups">Group Memberships</a></td></tr>
	<tr><td class="trow1 smalltext"><a href="usercp.php?action=editlists" class="usercp_nav_item usercp_nav_editlists">Buddy/Ignore List</a></td></tr>
</tbody>

Note the ID value of collapsed image (usercpnewmenu_img). This must have the same name as the tbody ID that you're trying to collapse.
It became like this when I try to put those codes:

<tr>

&nbsp;&nbsp;&nbsp;&nbsp;<td class="tcat">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="expcolimage"><img
src="images/collapse{$collapsedimg['usercpnewmenu']}.gif"
id="usercpnewmenu_img" class="expander" alt="[-]" title="[-]"
/></div>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div><span class="smalltext"><strong>Miscellaneous</strong></span></div>

&nbsp;&nbsp;&nbsp;&nbsp;</td>

</tr>

<tbody style="{$collapsed['usercpnewmenu_e']}" id="usercpnewmenu_e">

&nbsp;&nbsp;&nbsp;&nbsp;<tr><td class="trow1 smalltext"><a
href="usercp.php?action=usergroups" class="usercp_nav_item
usercp_nav_usergroups">Group
Memberships</a></td></tr>

&nbsp;&nbsp;&nbsp;&nbsp;<tr><td class="trow1 smalltext"><a
href="usercp.php?action=editlists" class="usercp_nav_item
usercp_nav_editlists">Buddy/Ignore
List</a></td></tr>
It's just the tabbing for your editor.

<tr>
	<td class="tcat">
		<div class="expcolimage"><img src="images/collapse{$collapsedimg['usercpnewmenu']}.gif" id="usercpnewmenu_img" class="expander" alt="[-]" title="[-]" /></div>
		<div><span class="smalltext"><strong>Miscellaneous</strong></span></div>
	</td>
</tr>
<tbody style="{$collapsed['usercpnewmenu_e']}" id="usercpnewmenu_e">
<tr>
	<td class="trow1 smalltext"><a href="usercp.php?action=usergroups" class="usercp_nav_item usercp_nav_usergroups">Group Memberships</a></td>
</tr>
<tr>
	<td class="trow1 smalltext"><a href="usercp.php?action=editlists" class="usercp_nav_item usercp_nav_editlists">Buddy/Ignore List</a></td>
</tr>
</tbody>

The above is pasted from UTF with tab spacing. If that doesn't work, you can just remove the &nbsp; text and fix up the lines yourself.
Yes!

Thanks Toungue I did! but I use other way however, if without your help I can't find the other solution .