Copy current page macro in Confluence - how to?

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 vote
Davin Studer Community Champion Aug 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?

Hi Davin,

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

Davin Studer Community Champion Aug 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>

Steven Behnke Community Champion Aug 27, 2014

I'm saving this bit of code!

Hi Davin,

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

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...

373 views 20 10
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you