Question

{{ asset:js file="theme::custom.js" group="default" }}
{{ asset:js file="theme::app.js" group="default" }}

{{ asset:render_js group="default" }}
{{ asset:render_js group="modules" }}

That's my code for my JavaScript, but when I load in production, it doesn't load the script tag. However, in system/cms/config/asset.php if I turn asset_min and asset_combine to false, then it loads the JS files individually, without combining or minifying.

But I want it to combine and minify.

Help?

Was it helpful?

Solution

You have to do has follow to render the JS assets :

{{ asset:js file="theme::custom.js" group="default" }} {{ asset:js file="theme::app.js" group="default" }}

{{ asset:render group="default" }} {{ asset:render group="modules" }}

I think asset:render_js don't actually works

OTHER TIPS

I have been having a similar problem.

It turns out {{ asset:render_js }} doesn't work, however <?php Asset::render_js(); ?> does.

So, for anyone else having problems in PyroCMS 2.2 using render_js, try the following:

{{ asset:js file="theme::javascript_file.js" }}
<?php Asset::render_js(); ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top