Home>Support>Page Builder not rendering sidebar correctly when using template in templates folder

Page Builder not rendering sidebar correctly when using template in templates folder

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi there,

Bit of a strange one here. Essentially I’m currently just playing around with page templates, and have encountered the below issue for pages using the Page Builder plugin on the Vantage premium theme.

I’m using a static homepage and using the Page Builder to insert a post loop widget. When setting the homepage Page Attributes > Template to “Default Template” (which picks up the page.php file from the Vantage parent theme), I’m ending up with the Homepage that you can see on http://laurencariscooks.com. Nothing changes if I copy the page.php file into the root of my child theme, which is what I would expect.
However, when I copy this same page.php file into the “templates” folder, give it a new file name, give it a new title within the file, and then tell my homepage to use this new template, my sidebar drops so that it only starts at the very end of my #primary content area. In other words, it ends up with a blank #secondary content area for the entirety of the page that is showing the post loop, with the sidebar content only beginning after the loop has finished.

If I use this same template on pages that aren’t using the Page Builder plugin, nothing changes – the sidebar stays in the same position.

Currently I’ve only tested this on my local site, so if you haven’t encountered this issue before and would need to see it in action, I’ll upload a test page to demonstrate.

Any help / clarification would be appreciated!

Thanks,
Ben

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 4 months ago Greg Priday
    Hi, I Work Here

    Hi Ben

    So basically what’s happening here is that Vantage doesn’t expect you to be using a sidebar on the home page. Regardless of template. I haven’t looked into this properly, but I’d actually say it’s a bug, so I’ll try fix this up in the next update of Vantage.

    For now, you can use some custom CSS to fix this. You’ll need to remove this if you ever want to go back to a more standard home page without a sidebar.

    .siteorigin-panels-home #primary {
    	float: none;
    	width: auto;
    }
    

    You can just add that to your custom CSS editor.

    • 10 years, 4 months ago Ben Short

      Hi Greg,

      Many thanks for looking into this and the response. That would be great if it did get fixed up in the next update – please do let me know if it makes it in there.

      In the meantime I’ll try out the custom CSS and get back to you on whether it resolved the issue.

  2. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for your understanding Ben. Let us know how that goes.

  3. 10 years, 4 months ago Ben Short

    Hi Greg / Andrew,

    Sorry for not getting back to you sooner – I only just got around to testing this out.

    Unfortunately the custom CSS didn’t fix the issue – the sidebar still drops when I switch to a template in the templates folder. Also, the “width: auto;” overrides my earlier custom css for setting the #primary and #secondary widths:

    /* Set sidebar width */
    
    .layout-full #primary { 
    width: 59.26%; 
    }
    .layout-full #secondary { 
    width: 33%; 
    }

    Do you have any other suggestions?

    Thanks,
    Ben

  4. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Hey Ben. Any chance we can see this in action? Can you re-create the bug quickly? I’m online for another hour or so.

    • 10 years, 4 months ago Ben Short

      Sure – let me see if it’s homepage only, and if not I’ll recreate the issue on a test page.

      Will update you shortly.

  5. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Super, thanks.

  6. 10 years, 4 months ago Ben Short

    Hi Andrew! I’m afraid it does only happen on the static homepage when using any template in the “templates” folder. It renders the sidebar fine on the homepage when using the Default template.

    As this is isolated to the static homepage, and using Page Builder on a test page with different templates didn’t re-create the issue, I do agree with Greg that this is a Vantage issue. However I’m reluctant to recreate the issue on my homepage on my live site.

    Let me know if you have any other suggestions – it’s not a critical issue, but of course I’d like to help squash any of those pesky bugs :)

  7. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    This is my usual fix for what I think you’re referring to:

    /* Page Builder Home Template Fix */
    
    .blog.siteorigin-panels-home #primary {
    float: left;
    width: 71.287%;
    }
    

    Let us know if it comes up again. That snippet should hopefully handle this until we’ve resolved the problem.

  8. 10 years, 4 months ago Ben Short

    Thanks Andrew – unfortunately the last solution didn’t help either.

    I’ll come back to you if I find any more useful info or if I manage to replicate the issue live.

  9. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Can you send me a ZIP of your child theme? Might be a bit quicker than me setting this up from scratch?

    [email protected]. No rush.

  10. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Apologies for the delay. (Thanks for helping out on another thread I saw on the forum, that’s almost most appreciated.)

    Please try this:

    .siteorigin-panels-home.page-template-template-full-notitle-sidebar #primary {
      float: left;
    }
    

    When using Page Builder on the home page you get a body class: .siteorigin-panels-home. There is a selector targeting that along with the other full width templates.

    Your new page template adds its own body class. As the two classes are in the same tag, the body tag, we omit the space and roll back the: float: none; that was there before with a regular: float: left; that we’d expect the primary div to have when a sidebar is present.

    Hope this makes sense. Let me know. We’ll go from there.

    Cheers

  11. 10 years, 4 months ago Ben Short

    Fantastic Andrew – that worked perfectly!

    Makes complete sense – we needed to increase / correct the specificity to get the float: left to take correctly. Many thanks for taking the time to look into this.

    And as ever, I’m more than happy to help out when I have a chance, it’s no problem :)

    Have a great day!

  12. 10 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    That’s it! Glad we could help and thanks waiting.

    Chat soon.

    Cheers

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More