How to link to anchor/heading in page in the search result?

Hans Bergsten December 4, 2013

If I have a Confluence page named "How to edit text" and it has an Heading 2 named "Auto Completion", searching on "Auto Completion" returns a link to the "How to edit text" page. Is there a way to also get a link directly to the "Auto Completion" heading/anchor?

4 answers

2 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 16, 2016

In case anyone is still interested in this, please have a look at below feature request recently recently for this:

https://jira.atlassian.com/browse/CONF-43672

 

 

0 votes
Matthew J. Horn
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.
December 5, 2013

The best approach I can think of is to detect the search term pass it to the next page the user navigates to (hopefully, a page in the results).

Then use JavaScript in your content pages that detect when a user is coming from the search page, and if so, extract the search term that was previously stored.

On page load, jump to the location of the first occurence of that term. You could get a little trickier and use JS to determine the next-higher heading tag of the found term on the page, and jump to that heading instead.

Hans Bergsten December 5, 2013

Hi Matthew,

Thanks for the suggestion. I see what you mean, and maybe that's the best that can be done, but I'm still holding out hope that there is a way to get links to anchors matching the search critera right there on the search result page.

Thanks,

Hans

0 votes
Steffen Heller
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.
December 4, 2013

@Hans:

If you want to create hyperlinks within a page Kirstin explained it.

If you are looking for a way to get better search results, meaning search results that link to a certain part within a page instead of linking to pages as a whole I am not aware of anything.

Hans Bergsten December 5, 2013

Thanks Kirstin and Steffen,

What I'm looking for is links to a certain part within a page in the search results. If anyone is aware of some solution, e.g. via plugins, interceptors or other "hacks", I'd be grateful for any hints.

Regards,

Hans

0 votes
Kirstin Seidel-Gebert
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.
December 4, 2013

Hi Hans,

click Insert > Link and then switch to Advanced.
In field Link, enter: How to edit text#Auto Completion
If the pages comes from another space, you'll have to add the space key before the page name, separated by a colon.

Refer to https://confluence.atlassian.com/display/CONF43/Linking+to+Pages for more information on linking to pages.

Regards,
Kirstin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events