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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set default template for home page and child pages

hello friends,

We are working on creating automated templates for each spaces in our confluence.

Requirement is when user Click "Create" or" ... "or "Create child page" . It should redirect to template that we defined.

Could you please suggest any workaround for this ?

Thanks in advance.

1 answer

0 votes

Hello Ganesh,

Thank you for contacting us!

You can promote specific templates within individual Spaces. See Promote templates in the Create dialog for more details.

If you're looking to change the behavior of the primary Create button, then I am afraid this is not possible. There is a feature request for this below:

 As a workaround, a solution is that you could use the Create from Template Macro. On any page, you can include this add-on to ensure that users are creating pages from the template that you specify. 

If you're comfortable modifying your site using Custom HTML, then there is another solution for you to try. Please note that this is an unsupported workaround. This workaround was created by my colleague in 2018, and so it can change slightly with future versions of Confluence. If you have any issues after applying this workaround, you'll want to undo the changes.

1. Create a global template (or use existing one) from General Configuration > Global Templates and Blueprints > Add Global Template
2. After Template is created, edit it, if you have an existing template you want to use, edit that one instead.
URL will contain entityId of the template, like such:

http://Confluence_URL/pages/templates2/editpagetemplate.action?entityId=123456

In the example above, entityId for my Test template was 123456, yours will be different.

3. Take a note of the entity ID and go to Custom HTML from your Confluence Administration page. 
Click Edit and add bellow script, replace <numbers> with entityId of the template you wish to use

<script>
  AJS.toInit(function(){
      AJS.$('#quick-create-page-button').attr("href", "/pages/createpage-entervariables.action?templateId=<numbers>&spaceKey=~" + AJS.params.remoteUser);
  });
</script>

 If the user does not have a Personal Space created, then the script above will not work, see How to override quick create page button in Confluence 5.9.xKB for more details.
Basically, you need to remove AJS.params.remoteUser addition and add space name following spaceKey instead of <space name> field bellow:

<script>
  AJS.toInit(function(){
      AJS.$('#quick-create-page-button').attr("href", "/pages/createpage-entervariables.action?templateId=<numbers>&spaceKey=<space name>");
  });
</script>

4. Save your Custom HTML and test page creation, check if it's working as expected.

Let us know if you have any questions about this.

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

494 views 24 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you