I am using Sage 11, and I am trying to render The Events Calendar shortcode. I have already installed the recommended supermundano package, and I am able to edit the templates.
However, if I create a component that is supposed to render the shortcode within page.blade.php or page-content.blade.php, the CSS and Javascript does not render. However, if I add the shortcode directly into app.blade.php the shortcode renders perfectly. There seems to be something being lost within the @yield(‘content’).
The supermundano package has outlined some specific limitations that appears to explain what is happening.
For the time being there can only be a blade view, the default-template.blade.php file, that allows the events page to work loading the Sage blade layout.
The events page is loading correctly. It is strictly the shortcodes for the calendar that will not render the javascript and CSS.
So on one of my pages I have the shortcode for the calendar that renders from page-content.blade.php and it renders with no styling and no javascript. However, if I take the shortcode and place it directly in the app.blade.php file, the shortcode will render with the CSS and JS.
Could it be because the CSS and JS are enqueued in the header and app.blade.php is called before that? But page.blade.php is included later on, after header scripts are injected?
No; the styles are controlled by the plugin and there’s a function that is supposed to injects the styles when the shortcode appears. Talking with their support, the styles are loaded within the main wordpress loop when the shortcode appears. Currently, when I use the content-page template, the styles do not load.
However, the calendar works when I just inject the shortcode straight into app.blade.php file. So somehow, the content within content-page resides outside of the wordpress loop? I have no idea what to do still