MyBB Community Forums

Full Version: How To Make {$subforums} Into Multiple Columns?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Does anyone know how to make the current {$subforums}:

[Image: 255hlk2.png]

Into multiple columns like this?

[Image: 11ipa3q.png]

The columns are going down, with a maximum of 3 rows each column, with infinite columns, with a 10pixel margin between the columns. The problem is it fetches these subforums dynamically, so I don't know how to make them into columns.

It will look much better in columns. Could anyone help me?
I believe this is just styling. These aren't stored in an internal table, instead I believe this is an HTML list.

So you should be able to find it in the style.css

Otherwise I believe this is edited in the admin >> templates >> Forum Bit >> subforum template
(2014-06-17, 11:55 AM)Dannymh Wrote: [ -> ]I believe this is just styling. These aren't stored in an internal table, instead I believe this is an HTML list.

So you should be able to find it in the style.css

Otherwise I believe this is edited in the admin >> templates >> Forum Bit >> subforum template

Hi,

Correct, these are just html links, but they are outputted dynamically so I can't style them into columns.

There is nothing in the style.css file in relation do this. There is nothing in the subforum template, which allows me to make the subforums into multiple columns.
you would need to edit this and add your own styling.
This may get better support in the themes forum by the way.
(2014-06-17, 12:10 PM)Dannymh Wrote: [ -> ]you would need to edit this and add your own styling.
This may get better support in the themes forum by the way.

Ok, but I have no idea what to edit, or what styling to add to make a dynamic PHP output into multiple columns, with a maximum of 3 rows each column. If this was a static output, multi-columns would be a piece of cake.

There are less people in the themes forum, no one ever seems to know the answers to my questions there. Maybe they are too hard...
http://community.mybb.com/thread-32008.html and instead of 50% in .alt_forumlar li {{width: 50%; float: left;} put 33%
this is what you would require: http://mods.mybb.com/view/subforumsincolumns
There is no need for a plugin since it's two template edits and two lines of css code.
(2014-06-17, 01:24 PM)Johnny S Wrote: [ -> ]There is no need for a plugin since it's two template edits and two lines of css code.

There are 2 problems with this:

1. I need the columns going down, not horizontally across, as I showed in 2nd screenshot in my 1st post.

Right now they go like this:

1st Subforum, 2nd Subforum, 3rd Subforum,
4th Subforum, 5th Subforum, 6th Subforum,
7th Subforum

I need them like this:

1st Subforum, 4th Subforum, 7th Subforum
2nd Subforum, 5th Subforum,
3rd Subforum, 6th Subforum,

2. I need to specify that 3 rows should get filled out in each column, before filling up the next column.

Does anyone know how I would achieve this? Either with CSS, PHP, Template Conditionals?
Open forumbit_subforums and replace all contest with this:
<style>
.alt_sbc {
    list-style: none; 
    margin: 0; 
    padding: 0;
}
.alt_sbc li {
    width: 50%; 
    float: left;
}
</style>

<ul class="alt_sbc">{$sub_forums}</ul>

Open
forumbit_depth3_statusicon
and add an <li> before the code, like this
<li><img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="subforumicon ajax_mark_read" id="mark_read_{$forum['fid']}" />
Open
forumbit_depth3
and replace everything with is:
{$statusicon}<a href="{$forum_url}" title="{$forum_viewers_text_plain}">{$forum['name']}</a></li>

This should give you your desired effect.
Pages: 1 2