MyBB Community Forums

Full Version: How to show subforums as a list in Forumdisplay?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.
I want to show subforums as a list on the forum display page. How can I do that?

ex:
[Image: eay30re.png]
Forum Bit Templates → forumbit_subforums - Change the template content like this:

<ul aria-label="{$lang->subforums}">
    {$sub_forums}
</ul>

Forum Bit Templates → forumbit_depth3 - Change the template content like this:

<li>
    {$statusicon}
    <a href="{$forum_url}" title="{$forum_viewers_text_plain}">{$forum['name']}</a>
</li>

Now you can customize this structure with CSS.
@tadem; Thank you for your help.

But what I want to ask is the subforums in the view below.

[Image: ib166n5.png]
forumdisplay_subforums
(2023-02-10, 10:52 AM)Taylor M Wrote: [ -> ]forumdisplay_subforums

I know this place.  However, the content is as follows, where the value "{$forums}" produces the same query as on the home page.


<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="5" align="center"><strong>{$lang->sub_forums_in}</strong></td>
</tr>
<tr>
<td class="tcat" width="2%">&nbsp;</td>
<td class="tcat" width="59%"><span class="smalltext"><strong>{$lang->forumbit_forum}</strong></span></td>
<td class="tcat" width="7%" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span></td>
<td class="tcat" width="7%" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span></td>
<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->forumbit_lastpost}</strong></span></td>
</tr>
{$forums}
</table>
<br />
(2023-02-09, 06:18 PM)tedem Wrote: [ -> ]Forum Bit Templates → forumbit_subforums - Change the template content like this:

<ul aria-label="{$lang->subforums}">
    {$sub_forums}
</ul>

Forum Bit Templates → forumbit_depth3 - Change the template content like this:

<li>
    {$statusicon}
    <a href="{$forum_url}" title="{$forum_viewers_text_plain}">{$forum['name']}</a>
</li>

Now you can customize this structure with CSS.

Thats because it uses the same code as tedem pointed out.
(2023-02-10, 10:34 AM)Hazel Wrote: [ -> ]@tadem; Thank you for your help.

You're welcome.

The same templates are used for both (index and forumdisplay) pages.

It can be styled differently according to both pages. I left an example below:

Define an id in the body tag of the index and forumdisplay pages. <body id="pageHome"> for index and <body id="pageForumDisplay"> for forum display.

Then customize it with CSS:

#pageHome ul.subforums { ... }

#pageForumDisplay ul.subforums { ... }
So you're saying there is no choice but to interfere with CSS??
I will do this by manually manipulating the code.
Thank you.