0
{{ 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?

David Gorsline
  • 4,933
  • 12
  • 31
  • 36
Shamoon
  • 41,293
  • 91
  • 306
  • 570

2 Answers2

1

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

Khalil TABBAL
  • 817
  • 6
  • 12
0

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(); ?>
atwright147
  • 3,694
  • 4
  • 31
  • 57