How can I make a link that will have in href exact text I provide, e.g. <a href="my_text">123</a>

 

2 answers

0 vote
Thomas Schlegel Community Champion Aug 04, 2016

Hi Dawid,

creating a link on a Confluence page results in a form with two fields:

  • Address  (that is "my_text" in our example)
  • Link text (that is "123" in your example

Cheers

Thomas

 

Hi Thomas,

Thank you for your answer. Unfortunately it does not work sad
Result is:
<a href="http://my_text" class="external-link" rel="nofollow">123</a> 
"http://" is added and it prevent my link from working.

 

Best,
Dawid 

Thomas Schlegel Community Champion Aug 04, 2016

What kind of link do you want to add to your page?

It is a link with defined protocol which runs application on local machine. It allows user to start program with given parameters by a link.
It look somthing like this:
app-version:///?param=value&param2=value

Thomas Schlegel Community Champion Aug 04, 2016

OK, I see. This is quite tricky. 

I've tested with regular confluence links - they always produced some kind of app-version://<our-confluence-url>/?param...

I think, the best way is, to write a user defined macro that produces this link. Try something like this:

 

## This is an example macro
## @param param1:title=param1|type=string|required=true|desc=param1description
## @param param2:title=param2|type=string|required=true|desc=param2description
<a href="app-version:///?param=$param1&param2=$param2">123</a>

 

The macro produces the following output on the page:

<a href="app-version:///?param=$param1&amp;param2=$param2" rel="nofollow">123</a></p>

Doesn't it require administrator privileges?
Anyway I managed to solve my problem by using HTML macro.

Thank you for you help!

Thomas Schlegel Community Champion Aug 04, 2016

You're welcome smile

Yes, creating user defined macros requires admin privileges.

Using HTML macro is doing nearly the same, but for security reasons, we do not allow our users to add plain HTML to their pages.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,792 views 26 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you