Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Power Scripts - How to change a title page

Christophe Chenavier February 19, 2021

Hi all,

I would like to be able to change the title of the current page by scripting.

How can I do that ?

 

Atlassian Confluence 7.9.3
Power Scripts 1.1.14

1 answer

0 votes
Tobias Helms March 18, 2021

Hi,

basically it's very simple. The question is, how experienced you are with scripting.

The code to change the title of current page is:

title = "This is a new title";

This can be used in combination with a listener.

If you want to refer to a particular page from within the script, then you need to add some more code like this:

string spaceKey = "DEMO"; //the key of your space
string pageTitle = "This is the old title"; //the title of the page you want to change
number page = getPage(spaceKey, pageTitle); //the page will be accessed by getting its unique id
%page%.title = "This is a new title"; //title of the accessed page will be changed

Cheers
Tobias

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events