Add JS or CSS to theme package purchaced from marketplace

Permalink
I have installed a theme which works as desired except that I wish to rotate the pages after a given amount of time of inactivity. I therefore wrote a jQuery plugin which works. I know need to include some JavaScript in all of the pages. How can I add this to all pages without needing to manually add it to each page in a block. EDIT. Oh, maybe just a site wide block?

Similarly, what is the proper way to add JS or CSS to a single page? In a block, or some other approach?

Thanks

View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
Various solutions
- Put it in a script or html block in a global area
- create a second package with the js file, declare the script as an asset and require it in an on_start
- embed it in the theme footer
- combine the above, declare asset then require it in theme
- add it in the dashboard like you would a tracking code
NotionCommotion replied on at Permalink Reply
Thanks Johnthefish,

- create a second package with the js file, declare the script as an asset and require it in an on_start
No problem with creating the package, declaringthe asset, and requiring it on_start. But what do I do with this new package? I've created a package with multiple single pages, and then added it under "Extend concrete5". I haven't done so, but it seems easy enought to create a theme package. Is there a third type of package that I would do this with?

- add it in the dashboard like you would a tracking code
I didn'tknow about tracking codes. Seem like a reasonable solution.