How can I define Parts of a Page to be easy reused?

Whta we need is some kind of Partial Template to insert in a page. I think this could be solved by a content macro?

Any other suggestions?

1 answer

Hi,

You could use the Excerpt Include macro - http://confluence.atlassian.com/display/DOC/Excerpt+Include+Macro

Create a library of excerpts and then use them in whichever pages they are needed.

Andrew.

Thanks, thats something i need too!

But my question was not specific enough. Lets say, i need a table for some vaules, that I want to include on several pages. But i dont want to write the Table from scratch every time.

Some kind of contentsnippet to reuse?

Ah ok, Struggling with this one a bit. If the table and its values are the same you the excerpt include would work for that as well, but if it's just a skeleton table and the values are different then a User Macro (http://confluence.atlassian.com/display/DOC/Writing+User+Macros) might work. For a user macro you could have something like:

## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name

## This is an example macro
## @noparams

<table>
  <tbody>
    <tr>
      <th>Year</th>
      <th>No. of Widgets</th>
      <th>No. of Grommets</th>
    </tr>
      $body
  </tbody>
</table>

where $body would be the text you entered between opening and closing {tablemacro} tags. The problem with this is that what you would have to enter for the body would be the raw HTML, e.g. <tr><td>column1</td></tr><tr><td>column2</td></tr> , which is more timeconsuming and error-prone than just selecting Insert -> Table in the editor .

Another really low tech option if it's just a table skeleton is create a page with different table layouts and copy and paste the one you want each time.

Andrew.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted yesterday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

107 views 3 3
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