Hi there,
we are using Confluence Server with a plugin that allows us to send whole pages by E-Mail. With this URL I can run the service:
/pages/mailpage/mailpage.action?pageId=$content.getIdAsString()
Works fine.
The problem starts when I want to include this URL as a link into the footer. Our footer is based on a page in CF and thus has its own Content ID. So everytime the link is called, it uses the CID of the footer and not the IDs of the pages the footer is included.
Is there any solution to this? Must be something like: check the page that includes the footer and use its id.
Thanks and greetings from Germany,
Franz
Don't build the URL in the footer page but using Javascript on the actual page. Do something like this:
In Confluence Admin | Look and Feel | Custom HTML
Add to one of the fields:
<script>
AJS.toInit(function ($) {
if (AJS.params && AJS.params.pageId) {
$('#footerEmailLink').attr(
'href',
[ AJS.params.baseUrl, '/pages/mailpage/mailpage.action?pageId=', AJS.params.pageId ].join('')
);
}
});
</script>
This assumes that you currently have a link like this in the footer:
<a id="footerEmailLink" href="/pages/mailpage/mailpage.action?pageId=$content.getIdAsString()">Email page</a>
The existing href attribute will be replaced with the correct one.
Thank you so much, works perfect!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.