Copy current page macro in Confluence - how to?

Rumceisz August 25, 2014

Hi All,

we need a macro that copies the current page. We'd put it in a page template.hence we are not acquinted with macro scripting, could you please give us some hints?

Thanks in advance,

Rumi

1 answer

0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2014

On every page there is a link in the tools menu to copy the page. Is there some reason you don't want to use that?

Rumceisz August 26, 2014

Hi Davin,

you're right, we just want to make it more handable.

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2014

You could put something like this into your page decorator in the spot where you would want it to be more accessible.

<script type="text/javascript">
    AJS.toInit(function(){
        AJS.$('#myCopyPageButton').click(function(event){
            event.preventDefault();
            window.location.href = AJS.Meta.get('base-url') + '/pages/copypage.action?idOfPageToCopy=' + AJS.Meta.get('page-id') + '&spaceKey=' + AJS.Meta.get('space-key');
        });
    });
</script>
<form class="aui">
    <button id="myCopyPageButton" class="aui-button">Copy Page</button>
</form>

 

 

Like Hartmut Leister likes this
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2014

I'm saving this bit of code!

Rumceisz August 27, 2014

Hi Davin,

many thanks!! +1 question: where is the page decorator you mention?

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2020

You can edit the page layouts in Confluence Administration -> Look & Feel -> Layouts.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events