Including variables automatically in page templates?

Is there a way to include a simple replacement variable in a page template that can be passed into a page template on creation? For example, to put "dynamic" or context specific information onto the page?

What I ahve done is use he create-child macro to create a page into a hierarchical page structure, based on user entered firstname and lastname (for sake of discussion, the page is called "Doe, Jane")

   {create-child:$paramlname, $paramfname|parent=$init|template=TAInformation}

At the time I create the page, I also capture the user account name that the data entry person looks up for this person, which may not have anything to do with the person's name - Jane Doe might have the user name "Gandalf" or "TwilightFan". I'd like to have that account name written into the page when it is built from the TAInformation template, without the data entry person having to go through and open the page, edit the page, enter the account name again. So, data entry maestro enters "Jane", "Doe" and "TwilightFan" and a page called "Doe, Jane" is created (got that working, above!) and the "TwilightFan" is shoved onto the page, *WITHOUT* the data entry maestro visiting the page and typing it in the page directly. Does that make sense?

Ideally, if there were something like this syntax, it would be great, but I'm looking for any ideas...

      {create-child:$paramlname, $paramfname|parent=$init|template=TAInformation|data=acct:TwilightFan,dog:Spot}

1 answer

1 accepted

0 votes
Accepted answer

You used to be able to do this sort of thing in Confulence 4, but I don't think there is a solution for Conflucence 5: See: How do you add template variables as macro parameters or in plain text macro bodies?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,029 views 51 8
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