How to open a link in the same new named tab, every time

Public, Tricks, Other Languages


Created: Nov 14, 2017     Updated: Nov 14, 2017

When you want a link to open up in a new tab, you simply set the target to _blank:

<a href="" target="_blank">Starfall</a>

But what if you have an index view containing all your Posts, and you want a link to each post's show view to all open up in a new tab, but the same tab.

Meaning if you click on five posts from the index view, you should only have a total of two tabs open. One for the index view, and one for the show view.

To do this, you simply change the target to any arbitrary named string:

<a href="" target="starfall-view">Starfall</a>