Show subforum in 2 columns

Sameer Memon
Sameer Memon
3 Min Read
xenforo show subforum in 2 column
- Advertisement -

Hello Geekers,

After so good response to some of our Xenforo Customization posts, I have decided to keep updating with new posts.

Today we are going to change the Layout of the subforum in Xenforo. Have a look at the before and after images:

xenforo subforum in two column
Xenforo subforum in 2 column

Don’t you like it?

It provides a clean look to the forum and takes less space as well.

Let’s start with this:

- Advertisement -

Go to Your Xenforo ACP > Appearance > Template.

Search for Extra.less

(Else create a new template and call them in extra.less)

Now that you are in extra.less paste below code:

body[data-template="forum_view"] {
@media (min-width: 800px) {
.node-main { display: block; }
.node-stats { display: none; }
.node-statsMeta { display: inline; }
.node-extra { display: block; width: auto; margin-top: -4px; padding-top: 0; }
.node-extra-icon { display: none; }
.node-extra-row { display: inline-block; vertical-align: top; max-width: 100%; }
.p-body-pageContent .block:first-child {
.node-icon {
width: 46px;
margin: 0 9px 0 0;
padding: 10px 10px 10px 10px;
height: 47px;
display: block;
float: left;
}
.block-container .block-body {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
}
.block-container {
background: rgba(255, 0, 0, 0);
border: none;
}
.node--depth2 {
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
border-width: 1px;
border-style: solid;
background-color: #fff;
border-top-color: #dfdfdf;
border-right-color: #d8d8d8;
border-bottom-color: #cbcbcb;
border-left-color: #d8d8d8;
}
}
}
}

how to show xenforo subforum in 2 grid
Adding code to the template

Click Save and you are done.

- Advertisement -

Check any of your Subforums. They should now occur in 2 columns.

Similarly, you can modify this code to show Xenforo subforums in 3 columns.

Use the below code for 3 columns:

body[data-template="forum_view"]{
    @media (min-width:800px){
        .node-main{display:block}
        .node-stats{display:none}
        .node-statsMeta{display:inline}
        .node-stats{display:none}
        .node-extra{display:block;width:auto;margin-top:-4px;padding-top:0}
        .node-extra-icon{display:none}
        .node-extra-row{display:inline-block;vertical-align:top;max-width:100%}
        .p-body-pageContent .block:first-child{
            .node-icon{
                width:46px;
                margin:0 9px 0 0;
                padding:10px 10px 10px 10px;
                height:47px;
                display:block;
                float:left}
            .block-container .block-body{
                display:grid;
                grid-template-columns:1fr 1fr 1fr;
                grid-gap:10px}
            .block-container{
                background:rgba(255,0,0,0);
                border:none;}
            .node--depth2{
                box-shadow:0 1px 4px rgba(0,0,0,.06);
                border-width:1px;border-style:solid;
                background-color:#fff;
                border-top-color:#dfdfdf;
                border-right-color:#d8d8d8;
                border-bottom-color:#cbcbcb;
                border-left-color:#d8d8d8
            }
        }
    }
}

If you like this post, do share it with your co-forum owners. It might help them

- Advertisement -
Follow:
Sameer Memon is a passionate writer with 3 years of experience in Blogging. With a strong background in Blogs, SEO, and Social Media Marketing, Sameer has been creating engaging content on various topics for a wide range of clients. As a dedicated and driven individual, Sameer takes pride in delivering well-researched and thoughtfully written articles that provide readers with valuable insights and information. He is constantly striving to stay up-to-date with the latest industry trends and techniques to produce content that is not only informative but also engaging and easy to read. When Sameer isn't busy writing, he enjoys gaming. He also loves to explore new places to gain fresh perspectives and inspiration for his writing. If you're interested in learning more about Sameer and his work, you can follow him on social media platform at give handles.