Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want the TOC macro links to NOT open in a new window

Chela Wallace May 11, 2018

Where are the settings that control whether TOC links open in a new window? I do NOT want it to do this; I want the links to take me to the corresponding headings on the same page. 

 

It used to work and now it doesn't. Having TOC links open in a new window totally defeats the purpose. :(

1 answer

1 accepted

1 vote
Answer accepted
David at David Simpson Apps
Atlassian Partner
May 14, 2018

I think someone in your organisation has decided that page content links should all open in a new window. 

I'm guessing that you're using Confluence Server and someone has followed the instructions here.

They've probably added something like this in the Custom HTML section in Confluence Admin...

<script>
AJS.toInit(function ($) { $('.wiki-content a').attr('target', '_blank'); }); </script>

...which will open all page content links in a new window.

Instead, they could use this...

<script>
AJS.toInit(function ($) { $('.wiki-content a:not([href^=#])').attr('target', '_blank'); }); </script>

...which will still open all content links in a new window/tab, but won't open the TOC/internal page links in a new window.

If your admin has installed the External Link Add-on, then they need to be a little more selective with their CSS selector.

Likely they can use the following as a CSS selector:

.wiki-content a:not([href^=#])

 

Chela Wallace May 14, 2018

Yes, that worked; thanks so much!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events