Displaying pages within a page or template

I am setting up a site where the sidebar displays a specific page on all of the pages in the site. I can do this through a widget or a template. The issue is that the Page Builder generated css classes are page id specific. What this means is that the sidebar page itself looks fine as designed in Page Builder, but when this page is loaded into the sidebar of any other page, all style attributes are lost. Is there a way make a page css file global? I don’t want to manually create a global css file every time I edit the sidebar page.

Thanks,
Dimitry

Hi Dimitry,

Thanks for posting! Unfortunately, we’re not able to get around that issue at this time. Let me try to explain…

The Page Builder only loads in the necessary CSS/JS that it needs for a given post when that post is part of the main WordPress loop. That is because we can use the main loop to see what posts will be on the page before the page is rendered.

When a widget is placed on the page to show a post, it is creating a secondary loop that runs while the page is being rendered and after we’ve inserted any necessary styles into the header. So, the styles needed for your widget won’t be available since we couldn’t possibly know about them before the page started rendering.

The reason we do it this way is to keep the pages on your site from getting bloated with unnecessary stylesheets and scripts like with other plugins. The Page Builder doesn’t just load in the complied CSS/JS for a page, it also loads in other required CSS/JS for things like the content slider or accordion modules if you have them active on your page. If you don’t, it doesn’t load in that CSS/JS. If we made everything global, we would have to load in a lot of code on every page request!

We would like to find a solution for those, but so far, we haven’t been able to come up with anything that isn’t a hack. Can you send me a link to the page with the sidebar you are currently working on? I would love to see more about this use case. Thanks!

Justin