Hi!
As there is not way to add link to new (blank) page in Confluence i've desided to make my own macro for this purpose.
So my macro is:
## @Param URL:title=URL|type=string|required=true|desc=Target URL
## @Param Caption:title=Caption|type=string|required=true|desc=URL Caption
<a href="$!paramURL" target="_blank">$!paramCaption</a>
Pretty simple and it works fine, except one detail - it ignores the "target" attribute!
On the rendered page code looks like:
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.
I'll try it, thanks!
For now i've done this macro and it worked:
## @Param Caption:title=Caption|type=string|required=true|desc=URL Caption
## @Param Link:title=Link|type=string|required=true|desc=Full URL Link
## @Param OpenType:title=OpenType|type=enum|required=false|enumValues=New window,Current window|default=New window|desc=Where to open link
#if ($paramOpenType == "New window")
#set ( $target = "_blank")
#elseif ($paramOpenType == "Current window")
#set ( $target = "_self")
#end
#set ($linkHtml = '<a href="'+$paramLink+'" target="'+$target+'">'+$paramCaption+'</a>')
<ac:structured-macro ac:name = "html">
<ac:plain-text-body>
<![CDATA[ $!linkHtml ]]>
</ac:plain-text-body>
</ac:structured-macro>
This is html macro wrapped in user macro, actually ^_^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.