Search code examples
pyrocmspyrocms-lex

How can I include a hosted JS file with PyroCMS / Lex?


To load files in my theme, I use {{ theme:js file="bootstrap.min.js" }}. But what if I want to load something from a CDN like http://code.jquery.com/jquery-1.9.1.js.

I tried {{ theme:js file="http://code.jquery.com/jquery-1.9.1.js" }} but that errors out.

Ideas?


Solution

  • You can link to it directly as you would normally without using an actual "tag." For example take a look at this header partial from the base theme of Pyro 2.2:

    https://github.com/pyrocms/pyrocms/blob/2.2/develop/addons/shared_addons/themes/base/views/partials/header.html#L33

    (note this example is a remote css file but, the same can be done with js files etc.)