I have a certain line of code which I've defined to appear in any of my space's pages.
This line of code calls a certain script that needs to take as a parameter the page's name, but I don't know how to automatically extract the page's name...
maybe there's a certain code-word for this or another solution you could think of?
If my line of code is:
I want PAGENAME to be automatically replaced with the name of the page.
Well, there's two ways you could do this:
1. Generate the link on the backend in a user macro. It would look something like this:
<a href="http://sde-cgi....&tag=$content.title" target="_blank">name of link</a>
$("#tag-link").html('<a href="http://sde-cgi....&tag=' + AJS.params.pageTitle + '" target="_blank">name of link</a>');
the target="_blank" is there to make the link open in a new tab. If you don't care about that, you can just remove that part.
interesting, I'm pretty new to this stuff so I couldn't understand the first option, and if you could guide me on where I can learn how to implement the second option it would be great...I know BASH/C++ so I think I'll be able to deal with JAVA if I'll have a good link to guide me...
The first option is a user macro: https://confluence.atlassian.com/doc/writing-user-macros-4485.html
This is based on Apache Velocity, which Confluence uses in the background as a templating language. It's basically Java, and has access to many of the Java libraries.
The second option can be placed in the HTML macro, as long as it is activated:
once you have activated the HTML macro, just insert it in a page and paste the text there, and it should work :)
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
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...
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!
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