Can a Web Object's URL be a project variable?
May 30, 2016
Hey folks,
I'm working on a new course, and it's going to involve interactions with database pages on the internet. I'm going to load particular pages from a database into my slides using 'Insert Web Object'. Now, for my needs, there are a ton of different pages online that learners might find useful to look at within my course. Each of those pages on the interwebs has an identical URL, except that the last four characters of the link point to a particular page.
What I want to know is: has anybody figured out a way to load a user-defined variable into the URL of a Web Object? I.e., Can I somehow have the user punch four numbers into a numerical-entry form in my slide, then have the Web Object load: "http://www.BaseURL.com/%those_four_numbers%.html". Does this make sense? I hope this makes sense!
Thanks for your advice,
Dylan.
6 Replies
Hi, Dylan -- Thanks for reaching out, and while I am not aware of a method to suggest to accomplish what you have described, perhaps others in the community have accomplished something similar and can share some ideas to assist. :)
I had a feeling it wouldn't be possible. Thanks anyway, and please feel free to close this discussion now. :)
Matthew's post regarding javascript is a great starting point. Two points of note: 1) javascript isn't supported in the mobile player and 2) the javascript solution isn't for the timid as it's quite complex (and requires intermediate knowledge of javascript).
The core work is documented quite well:
https://community.articulate.com/discussions/articulate-storyline/webobject-and-storyline-variable
If your clients don't mind a second, popup window I create a trigger that executes open(link,"_blank") on click, where link is constructed by reading several project variables via player.GetVar() as shown in the thread above.
Hello Dylan,
Here is what I came up with. For testing purposes, I uploaded two pages to our company website. 0001.html and 0002.html
The are two variables in the project. One for the Text Entry and the other for the base url.
Great work, Russell! I was able to use this to change YouTube video URLs—which in turn we will store in a database and load via JavaScript. So, ultimately, if we need to re-post the YouTube video (which will assign it a new URL), we can just change that value in our database without re-publishing the Storyline course. Nice!
I keep seeing that Javascript does not work with the mobile player, but I am using it and it is working as expected. Has this changed does anyone know?
This discussion is closed. You can start a new discussion or contact Articulate Support.