Forum Discussion
Functionality for printing in Storyline
I am working on a project that gives the user the choice to view job aids in the moment when they are learning the related material. I want to allow the user to click a button to add the job aid to their "cart" to bulk print at the end of the eLearning.
I would use a true/false variable for the user to "add" the file to their "cart" which shows all the files they selected to print on the last slide.
Question
- Can I have ONE print button that will trigger all the files that are marked as true in the list on the last slide to print?
I know this can be in the resources tab, but there will be a good amount of them, and I want users to choose in the moment if they want to print what they are viewing instead of having to open each file in resources to review it.
Unfortunately, I do have Storyline's AI tools at this time.
Any help would be appreciated.
2 Replies
- AndrewBlemings-Community Member
Just to clarify my understanding, by "print" you actually mean download? Clicking a link in the resource tab (for me) just downloads the file, after which then the user obviously retains the choice to open and print any downloaded documents.
If that's your goal, then you're in luck, yes.
When I hover over a file uploaded to the resource tab, I can see the thing I can click is itself a button that contains the JavaScript
DS.windowOpen.open({ url: 'story_content/external_files/myDoc.docx' })
That same code can be added to a trigger that Executes when the user clicks a button of our choice, and the file will similarly download as if the learner had clicked the Resources item.
A more direct answer to your question could be to have one trigger for each downloadable file, all of which trigger when the Download Cart button is pressed, and then give each of those triggers a condition that checks if it was added to the cart. You mentioned a true/false variable being toggled when they add it to their cart, so those would be perfect to leverage.
Any resources the learner didn't add to their cart would have their download JS skipped when the user clicks the button. If you have a lot of documents and/or want to keep the number of triggers low and/or want to flex your JS, consider a single Execute JavaScript trigger containing something like
if (getVar('JA1Added')) DS.windowOpen.open({ url: 'story_content/external_files/JA1.docx' });
if (getVar('JA2Added')) DS.windowOpen.open({ url: 'story_content/external_files/JA2.docx' });
if (getVar('JA3Added')) DS.windowOpen.open({ url: 'story_content/external_files/JA3.docx' });
The most amount of labor will probably be collecting all of the hyperlinks shown in the Resources dropdown, though notice in the URL that they're all just the file's name.
Lemme know if it works for you.
- KristenNicholsCommunity Member
This makes sense! I'm not great with JS but I understand what you're saying. I'll give it a try, thank you very much.
Related Content
- 4 months ago
- 10 months ago