Create a New Template and call them in Extra.less

Sameer Memon
Sameer Memon
2 Min Read
using new template in xenforo
- Advertisement -

Why are you filling up your extra.less template when you can just create a new template for each of your modifications and then include this new template in your extra.less template in just one line.

check below image:

making custom template in

Which one are you? comment down

You can see on the left are things every newbie does – Adding all the custom codes in extra.less

while on the right is the best way to avoid clusters and confusion of the codes.

In this method, we just create a new template and include this template in extra.less

- Advertisement -

Let’s start:

For this we will go to Xenforo ACP > Appreance > Template.

Click on “Add Template

how to create new template in xenforo

Name your template. Make sure that the name you select is unique and isn’t being used by any other templates. The name should end with .less

- Advertisement -
creating custom templates in xenforo

For reference, I will name it subforumin2grid.less since I will use them to change my subforums to a 2-column layout.

Now add your custom code in the text area and click save at the bottom

how to make custom template in xenforo

You have now created a custom template.

Now it’s time to call this template in your extra.less to work in the forum.

Go to extra.less template same path as earlier

Add the below code to call your custom template in extra.less

- Advertisement -
{{ include('subforumin2grid.less') }}

Change “subforumin2grid.less” with the template name you assigned

calling custom template in xenforo
calling the custom template in xenforo

Click SAVE and done.

You have now learned how to create a custom template in Xenforo and include them in the working style.

Share this with someone who needs it. See you soon with another useful post !!

- 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.