Open Link in Same Tab

May 29, 2019

I've seen this discussed before, but I have not found a clear answer. I need a link  to open in the same tab as the rise course. Essentially, this will exit the course and go to a page of my choosing. The Exit Course option does not work within the LMS I'm using (Moodle). However, if I can get a link to open in the same tab, this will give me the control I need. It appears all links default to opening in new browser tabs. Is there a way around this behavior?

46 Replies
Corey Callahan

If you're comfortable with vanilla Javascript, you can add this on your exported page within a script tag. It seeks out any anchor tags with a specific domain and swaps out the "_blank" target attribute with "_self". I've put a timeout on it, because even though I'm firing this after the DOM loaded, it didn't seem to work without a delay.

var domReady = function(callback) {
document.readyState === "interactive" || document.readyState === "complete" ? callback() : document.addEventListener("DOMContentLoaded", callback);
};

domReady(function(){
setTimeout(function(){
var nldLinks = document.querySelectorAll("a[href='https://yourdomain.com/']");

for (var i = nldLinks.length - 1; i >= 0; i--) {
nldLinks[i].setAttribute("target","_self");
}
},1000)

})
Frank Hansmann

We would need this feature urgently. I tried the mentioned javascript method. But it ist did not work as I have expected. Could you be so kind and dicribe how this works in your case.

I tried to ad your pice of script into the "main.bundle.js". The result was, that the cours did not start at all.

ClassLink Learning Design

We have many needs for link customizations; the highest need is a link opening in the same tab. For example, we are making a living glossary of terms in Rise and we do not want a new tab for each letter of the alphabet. With several million clients, we need a solution that will work similar to the "Start" button. Can Articulate create a toggle or similar solution for hyperlinks to open in the same window?

Aidan Hoyal

We also need this functionality - we have created a master course in Rise that links to several smaller lessons in the LMS - the learners get so confused when multiple windows keep opening. It would be really helpful to be able to specify where links open. 

I tried creating a storyline block to pull into Rise and couldn't get it to work. I created a button with trigger to open a URL in the same window. I pulled this into the Rise course as a block. No luck.