Hi,
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" )
#else
#set( $target = "_self" )
#end
<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>
I knew the workaround "adding javascript code to add the target attribute based on the external-link class".
Hi @Marc Wampfler and @Ulrik Schoth , i suppose this issue relates to CONFSERVER-54958
Best regards, Marco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.