Best place to put JavaScript functions for publishing

I'm new to Articulate and Storyline.  I have a few custom JavaScript functions that I use and would like to put them into one of the Storyline publishing templates so they're available every time I publish rather than having to copy/paste them into the JS editor in Storyline every time.  Is there a best practice or a particular JS template file I can use for placing customized JS functions? TIA!

10 Replies
Jim Leichliter

Thanks Phil!  That does help.  I was hoping for a way to add or alter a .js file publishing template so that I wouldn't have to make the change after every publish.  I'd like to automatically include these JS functions no matter what project I'm working on.  The below method requires you to alter the published output every time you publish:

If you'd like to include all your JavaScript functions in a separate JavaScript (.js) file, place your custom JavaScript file in the story_content folder of your published output, and add the following line of code to the story.html file (line 113).

Jonathan Rose

Hi, was there any update or progress on adding this as a feature? I would like to be able to add custom JS in the manner recommended by the JavaScript Best Practices page, without having to manually re-add the lines after every time I 'Publish'. 

The current (admittedly unsupported) method is also a bit dangerous if you are not paying attention, as Publishing your Story will vaporise any custom .js files you have added to the directory. If you don't have a backup elsewhere it could be a frustrating way to lose work.

 

Leslie McKerchie

Hi Jonathan and welcome to E-Learning Heroes. 😊

I do not have any update on this feature. You can see our upcoming plans here:

Articulate 360 Feature Roadmap

I wanted to share some information about how we manage these feature requests as that may be helpful. I also encourage you to share your idea and use-case directly with our team here.