I am trying to create a template where the title of the page (which the user will need to define when using the template, so not pre-existing) can be used in other parts of the new page as a variable.
For example, the page variable used as a heading for a TOC Macro which will reside at the bottom of the page - useful for reminding users of the topic on long pages where the title is no longer visible when you get to the end. Currently I have a cumbersome instruction to insert the page title above the TOC Macro in the footer - this obviously is not dynamic so if the page title is renamed a mismatch will occur if editing the TOC heading is not done as well.
Ideally I would like to be able to do this without coding, but of course also have interest in any such solutions too.
This is only possible with coding :) I think you can use a user macro.
The user macro is really simple
## @@noparam
$content.getTitle()
And then in the template use this user macro.
Regards, Dominic
Thanks Dominic for your answer,
Some code is fine as long as it does not have to be done in the back end.
I do need a little clarification.
What is a 'user macro' - in Macros I search user but there is not one simply named 'User' that I can choose available to me (seclections include Content by User, Profile Picture, User List and User Profile).
Am I mistunderstanding (I tried putting the code inside a HTML macro but is simply prints) - websearch suggests getTitle() is javascript but I cannot find a macro for that...
Confluence docs on User Macro seem to point to admin level config, but our instance does not have this option (maybe disabled/hidden or not available in the version we are running 6.15.9)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.