Forum Discussion
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!
16 Replies
- PhilMayorSuper Hero
Hi Jim
Have you seen this page http://www.articulate.com/support/kb_article.php?product=st1&id=llwes8cn32vg
Its in there
PHil
- JimLeichliterCommunity Member
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).
- BrianBattFormer Staff
Hi Jim,
The files have to be added post-publish. If you'd like to see the ability to include certain files with each publish of a specific project, please submit a feature request to us:
http://www.articulate.com/support/contact/submit.php?form=feature
- JimLeichliterCommunity Member
Thanks again Brian,
I'll go ahead and submit a request.
...you sure do keep busy! Have a great day!

- JimLeichliterCommunity Member
I've tried submitting a feature request, but every time I do I get the following error:
"We are having trouble posting your request. Please try again in a bit."
I've been trying for the past 30 min. I'm guessing the PHP server is having trouble posting the form?
- JustinWilcoxCommunity Member
I didn't have a problem. What web browser are you using? Did you include a screencast or a file upload?
- JimLeichliterCommunity Member
Ok... I had a http:// link in the description field and it didn't like that. Once I removed that it sailed on through. Thanks!
- PeterAndersonFormer Staff
We got it. Thanks for the input, Jim!
- JonathanRose-ccCommunity Member
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.
- MathNotermans-9Community Member
No need for adding it after publishing. Several options to set your Storyline files up so each time you get all code as needed...without worrying about it.
- Use a WebObjects to add it to your title. This way it is always available. However when you change anything in your scripts you have to remove and reinsert the Webobject. As i donot like that i figured out a alternative.- Add the files/scripts to your Programme Folder for Storyline
C:\Program Files (x86)\Articulate\360\Storyline\player\unified
C:\Program Files (x86)\Articulate\360\Storyline\player\unified\html5\lib\scripts
You would need to change the html's added there too, so that on every publish you get your added files. Drawback in this is when you share Story's with coworkers..if they havenot set it up similar... they will miss the files and it wont work. And each time Articulate updates you need to redo it ;-) And offcourse this is not supported by Articulate..- JonathanRose-ccCommunity Member
Hi Math, thanks for the tips. Will try out that second method, which should speed things up a bit. I am currently the only one in my team using Storyline so there is no concern of coworkers missing the files. Cheers.
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.