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

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

Accepted Answer
0 votes
David Simpson Community Champion Jan 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 ;-)

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.

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.

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

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.

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

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

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?

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

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

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.

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.

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 ;)

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.

You're welcome :)

Hello

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 09, 2018 in Confluence

Introducing Praecipio Consulting, an Atlassian Solution Partner

Hey there Community!  My name is Vannya Vallejo, the Channel Communication Specialist at Atlassian and I want to help Atlassian users like you learn about our Solution Partners and how they c...

374 views 0 9
Read article

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