I wrote a "User Macro" to add links with some options.
In the user macro is a link with the HTML attribute "target", but if I'm using the user macro, the "target" attribute is missing.
What is my fault?
SIMPLIFIED user macro CODE (there is much more code in the user macro)
## @param Target:title=How to open the link|type=enum|enumValues=New,Current|default=Current Window|desc=Defines how the link will be opened.
#if( $paramTarget == "New" )
#set( $target = "_blank" )
#set( $target = "_self" )
<a href="http://www.google.com" target="$target" data-target="$target">Google</a>
The "target" attribute is set correct, see the "data-target" attribute.
The HTML source code resulting in
<a href="http://www.google.com" data-target="_self" class="external-link conf-macro output-inline" rel="nofollow" data-hasbody="false" data-macro-name="av-test-macro-code">Google</a>
Take a look at this article https://confluence.atlassian.com/confkb/how-do-i-make-my-attachments-open-in-a-new-window-or-tab-313459830.html
Looks like the target needs an _ in front of it. You can try it and see if that works.
The linked article shows the underscore only in the example
<A href="newwindow.html" _TARGET="_blank"_>a new window</A>
and not in the preceding text: You need to add a TARGET = "_blank" to the <a href> HTML tag.
I guess the underscore in the example is a typo: If you use it, the whole attribute goes through but the browser does not recognize it.
So, this suggestion does not help unfortunately.
Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events