1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom Templates

Discussion in 'XenForo Pre-Sales Questions' started by Drae, Jul 19, 2012.

  1. Drae

    Drae Active Member

    Some more questions for you!

    Today I'm asking about custom templates. If I wanted to have a custom template (two actually) at the bottom of the site, how would I code it in? I code the template in CSS then...? How do I add it to the layout?
    HenrikHansen likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The template system allows you to edit existing templates and add new ones, and even inline new templates that you create. You can edit the HTML and CSS templates to customize the style in any way you want.

    If you are working with the demo then you can see code examples in this template:

    Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

    This template contains the HTML skeleton that is used on all front end pages. You can see it includes other templates.
    Zephyr likes this.
  3. Drae

    Drae Active Member

    So in PAGE_CONTAINER, I would just put something like this?

    <xen:include template="custom_template_affiliates" />
    <xen:include template="custom_template_bottomlinks" />
    Either below or inside the footer?
    Zephyr likes this.
  4. Drae

    Drae Active Member

    Awsome. Just tried it, worked beautifully. Thank you for your help!

    How would I change the background colour of a custom template on the skin? For example, my current demo, has affiliates at the bottom, but I would like to specify a background colour (maybe even an image) for that area. Putting CSS styling in the template didn't work, so where would I go/what would I do next?
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Your custom template would contain the HTML. You can use inline styling in the HTML:

    <div style="background: red;">
    Or you can reference a class:

    <div class="myclass">
    Then define the class in this template:

    Admin CP -> Appearance -> Templates -> EXTRA.css

    	background: red;
    Drae likes this.

Share This Page