I've created a small user macro which return the page id: $content.getIdAsString()
Works quite well to add this to a page when in being in edit mode.
How, better where, to place this line to get this line automatically added (and non removalbe by users) to all confluence pages (in header or footer)?
Same question for external macros: I would like to have "Viewtracker" at bottom of every page.
I've tested "Admin > Layouts > Main layout", but did not find the right line where to add my code.
Did only get the macro-code renderdered as text (not executed) and often overlapping to the existing texts.
Thanks,
Markus
PS: Unfortunately Atlassian "lost" all my karma points when merging twom accounts...
Hi! You can render macros here the same way you would use to render macros inside macros:
#set($globalHelper = $action.getHelper()) $globalHelper.renderConfluenceMacro("{MYMACRO}")
There's even a $page variable available in the page layout, so you could even use this one directly instead of your macro code.
Regarding the "where" - look through the code of the "page" layout (and blog, if you need that too) to find your desired position, it's pretty linear and quite easy to understand.
For the documentation theme, try to insert the viewtracker macro via "Space Admin" => "Themes" => "Configure Theme" into "Messages" header or footer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, if you want it to be part of the breadcrumb navigation, you need to update the breadcrumbs.vm in C:\Program Files\Atlassian\Confluence\confluence\breadcrumbs.vm. I've tested it with v5 of confluence but should be the same for v4.
At the end of the document look for
## </li> #end </ol> </content>
You can just add another <li> element between #end and <ol>. $page.id is working here, so
## </li> #end <li>$page.id</li> </ol> </content>
results in
(no restart required for this)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot Superuschi (Daniela? :-).
This works very well! Do you happen do know where to find more page.xxx properties; e.g. the tinyurl?
Greetings from DU to OB /Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On admin- and profile-pages unfortunately the "$page.id" does not get rendered but is shown as plain text.
Do these pages do not have a unique id?
Regards /Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Superuschi
This works, thanks!
I need to change the position, though.
The pageid and TinyURL shall be presented after the page breadcrump list
Pages / Level 1 / level 2 / instruction (PageID: xxxxx, URL: yyyyy)
I've read a lot but still am confused (due to missing knowledge) what constructs to use:
#set($globalHelper = $action.getHelper())
$!globalHelper.renderConfluenceMacro("{getpageid}")
or $sitemeshPage.getProperty("page.pageID") or similar
or ${page.id}
or {page-info:tinyurl}
or AJS.$(
"#pageId"
).val()
or ...
Nothing really works...
Thanks /Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Oliver..we are using the default theme where this options are n/a.
I still suppose adding "code" to "Admin > Layouts > Main layout" will help, but what and where?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Put in a support ticket for the karma points problem - the same thing happened to me and they fixed it. :)
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.