Forums

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

Is it possible to create a Button with a Anchor link?

Vishnu September 23, 2024

I would like to create buttons but I need the button hyperlink url to point to another section in the same page. I can use Anchor link but I need that as a UI button. 

3 answers

0 votes
Robert Reiner _smartics_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2024

I am not sure what you mean by "UI button", but if you are okay with a link and only need it to appear as a button, you may use CSS to style your link as a button.

You would need to provide the CSS at space or site level (see https://confluence.atlassian.com/doc/styling-confluence-with-css-166528400.html).

For the styles to render the link as a button  you may start here : https://stackoverflow.com/questions/8357058/how-to-make-an-html-anchor-tag-or-link-look-like-a-button)

You would probably need to have means to set the CSS class of an element where the link is part of (so that not every link appears as a button). This could be done by a user macro, for instance see https://community.atlassian.com/t5/Confluence-questions/How-to-include-a-class-in-a-user-macro/qaq-p/1163802).

It may be a little cumbersome since every link needs to be wrapped inside this user macro. But it may be an option.

0 votes
Barbara Szczesniak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2024

@Vishnu I'm not sure if it works the same way in Data Center as Cloud, but the way I handled this:

  1. Create an image that looks like a button.
  2. Insert the image in the desired location on the page.
  3. Set a link for the image. This can be a link to anywhere you want, including an anchor on the same page.
0 votes
Nikola Perisic
Community Champion
September 24, 2024

Hello @Vishnu , creating a button in Confluence is not available possible. However, with ScriptRunner for Confluence you can create a button and make the links to it. These are Script Fragments, where you add a new web item, which in your case would be a button.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events