Viewport header URLs opening new tab/window
The viewport setup allows you to define up to 5 URLs to be included in the header and footer of the theme. I have set these up as pointers to major sections of our product site. The challenge I have is that the URLs end up opening a new window ro tab (depending on the browser behavior).
Is there an option to override this behavior?
-
Official comment
Hi Dan,
Thanks for reaching out! It sounds like you're using our Help Center Theme. Could I ask if you're using Scroll Viewport on Confluence Server or Confluence Cloud? For Cloud, we are about to release an improvement to make internal links (that is, links to other pages of your Viewport help center) open in the same tab.
You can use https://k15t.jira.com/browse/VPC-144 to track the progress on the issue.
However, in your case, when you say 'major sections of our product site', are these pointers to pages in your Scroll Viewport help center or outside of it (external links)?
Cheers,
Laura
Comment actions -
I started with the Help Center theme but have made some changes per the model. This is running on Datacenter.
In the setup of the CSS I included a set of top line pages we want to focus on. The side nav is not a 'normal' for the type of work we are doing. The issue is that when you click on them they open a new browser window (almost like the URL has a target=_blank operator vs a target=_self)
-
If you're using the Help Center Theme you can inject custom JS to override the default link behavior.
You will have to create a custom JS file with custom code and upload that file to the rest of the theme files. The custom code could look something like this:
$(document).ready(function(){ // Make header links open in the same tab $('.header__navigation__menu-container--link > a').attr('target', '_self'); // Make footer links open in the same tab $('.footer__links > a').attr('target', '_self'); });
Cheers,
Laura
Please sign in to leave a comment.
Comments
4 comments