Card macro - Is there a way to link to a specific card? (like using anchor or something like that)

Fabian Lopez January 25, 2012

I have information organized by cards (deck-card macro) and I would like to add links to specific cards from other pages. Is that possible or should I use a different macro to organize the information.

5 answers

1 accepted

0 votes
Answer accepted
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 25, 2012

With a bit of JavaScript on the source and target pages this could be achieved. Likely the most user friendly way to do this would be to wrap the links in a user macro that appends ?targetTabText=Click+Me to the target page URL. The target page would have a user macro containing some JavaScript that grabs the request parameter, searches for tabs containing that text -- "Click Me" -- and performs a click event on the tab thus revealing the content. I'd do it now if I wasn't using a mobile device ;-)

Fabian Lopez January 25, 2012

Thanks David!

0 votes
SandeepVK March 16, 2016

Hello

Is there any solution? I am a beginner so it would be very helpful if you can share the code

0 votes
Laurent Corbière February 22, 2016

Hi,

Here is a workaround:

  • give an ID to your card. Lets say "anchor2" for the 2nd card. Your deck has already an ID you choosed. Lets say it's "mydeck"
  • to make the link, use the HTML macro
  • then, inside the HTML macro, make your link like this:

    <a href="PAGE URL#mydeck-anchor2">LINK NAME</a>

Have a nice day

Colin Kemp March 19, 2018

I've tried this from a direct URL entry  e.g.

 

https://<page-url>#mydeck-anchor2

 

with no luck 

Details:

Confluence 6.7.1

Chrome: Version 64.0.3282.186 (Official Build) (64-bit)

Windows 10 

 

Is there actual official reference documentation from Atlassian somewhere on how to use the card id as an anchor in a deck of cards?

Laurent Corbière March 19, 2018

Hi Colin,

 

I just tested it on Confluence 6.5.2 / Chrome 65.0.3325.162 / Windows 7, and it's functionnal for me.

There is no official doc. I found it by inspecting a classical anchor url.

 

Regards

Colin Kemp March 19, 2018

Well - thanks for the quick response.

I tripled checked the mydeck ID and the card ID and formed the URL with 

<mydeckID>-<cardID> as you suggest but when I bring the page up the first card is the one on display.

I'll keep having a look

Laurent Corbière March 19, 2018

Just to make sure, the url to "yourspacekey" with "more than one word" page title should be:

...confluence/display/yourspacekey/more+than+one+word#mydeckID-cardID

 Make sure that your page doesn't have any special characters because it'll turn your url name in page id.

Colin Kemp March 19, 2018

Thanks again.  Yup I dumbed down the tags since they had an _ and a . but still no luck.

Essentially looks like:

.../confluence.company.com/display/space1/Release+Notices+Bulletin+List#releaseNotices-r13

where

Deck of Cards id = releaseNotices

Card Id - r13

 

There must be something else messing up on the page, as it defaults to the r1 (first) card tab each time for me.

Laurent Corbière March 19, 2018

Maybe you should try on test page with simple page title, simple anchors name and 2-3 tabs without content.

Sorry for this newb error check, but make sure that you don't mix up card label and card id ;)

Colin Kemp March 22, 2018

Laurent,

I created a test page as you suggested.  Everything works perfectly with the new page.

Even to the point where when you select the new tab, the URL in chrome is automatically updating when the you traverse between the cards:

 

.../confluence.company.com/display/myspace/Deck+of+Card+indexing+test#deck1-card1id

click on card 2 and the broswer URL automagically becomes:

..../confluence.company.com/display/myspace/Deck+of+Card+indexing+test#deck1-card2id

 

So I'm speculating it might be a "legacy" issue with pages with Deck of Cards created before a certain point because I can't get it to work on that page.  I might try creating a new page and migrating content over from the one that is not working to see if I can get it to work ... thanks for all the interaction on this one Laurent.

Laurent Corbière March 23, 2018

You're welcome :)

Truc Nguyen April 3, 2019

Hi Laurent,

Questions for you:

  • I am using an older version of Confluence 5.10.8 -- will your work-around work?
  • When you said HTML Macro --> is it the Bob Swift HTML Macro?
  • And to make the link --> where would you add this script to in the HTML Macro?
  • &lt;a href="PAGE URL#mydeck-anchor2"&gt;LINK NAME&lt;/a&gt;

I have tried it out making sure that the page doesn't have any special characters like your example

confluence/display/yourspacekey/more+than+one+word#mydeckID-cardID


But I still cannot create the link so that I can use to access to a specific card in the Card macro.

Truc Nguyen April 4, 2019

Thanks, I found my answers.

0 votes
David Peterson
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.
January 25, 2012
If it's not working, feel free to raise a bug report at http://greenhouse.customware.net/jira/browse/POSI with the details of browser, Conf version, etc.
Fabian Lopez January 25, 2012

https://greenhouse.customware.net/jira/browse/POSI-167

done. Thanks!

Good job on this one. Thanks!

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
March 8, 2014

Was there any resolution to this? The link is broken.

0 votes
David Peterson
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.
January 25, 2012
It's possible with Composition 3 for Confluence 4.x. It should add a #anchor for each tab, which will also work coming into the page directly.
Fabian Lopez January 25, 2012

Thanks david that is the one I am using.

I enter an anchor on the body of card and then a link to that anchor but it is not working.... I will test it again.

Fabian Lopez January 25, 2012

I tried adding an #anchor on each card, in the first line of the card box.

then I created links to that anchor, the address bar is changing as I click on each of the links but the tab is not opening. When I click on the link that is for the active card/tab the body of the moves up having the top of the screen where the anchor is. This works only with the tab that is open in that moment

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events