href in a variable

Jul 19, 2023

I have a small Javascript (below) that I want to create a hyperlink in a portion of the variable when it is displayed on the next slide. The idea is that the user will be able to keep adding new information to the "ActionItems" variable and have all the links available to them at the end of the course.

Here's my script:

var player = GetPlayer();
var newitem = player.GetVar("ActionItems") + "\nDownload the App on <a href=\"https://play.google.com/store\">Google Play</a>";
player.SetVar("ActionItems", newitem);

 

It shows all the text just fine, but no hyperlink.

1 Reply
Richard Watson

Jacob,

I'm not sure you can do this. I know in the past this was submitted as a feature request as shown in the link below.  

https://community.articulate.com/discussions/articulate-storyline/text-variable-in-hyperlink

The only approach I could use to create a hyperlink for the variable was inserting the reference variable onto a slide, right-clicking the variable, and adding the hyperlink: https://play.google.com/store

Anyway, we'll see if someone can add to the thread.

Richard