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")

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

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

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

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 Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,030 views 15 13
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