Dashboard > Atlassian Plugins > ... > Macros > boilerplate
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  boilerplate

Added by admin , last edited by David Peterson on Feb 27, 2007  (view change)
Labels: 

{boilerplate}

Plugin: Scaffolding Plugin, from version 1.4.1 until version 1.4.18

Deprecated! Imports and renders the current version of a template.

Description

What {boilerplate} does essentially is that it takes the text content of a Page Template (Note: not a Scaffold! You get to Page Templates via 'Browse Space -> Templates') and render that text in the context of the current page. It doesn't matter if there is a {scaffold} macro on that template or not, it just renders the text as wiki text. This is different than creating a page with a template as in the built-in system because that will copy-n-paste the text in once, but if you update the template, the page you created with the template will not get updated.

Usage

{boilerplate:Page Template Name}

Parameters

Name Required Default Description
[default]
The name of the page template to import and render.

Notes

You have a set of products and want all the product pages to have a similar structure. Here are the steps:

Create the template
  1. First, create a new Page Template (Browse Space -> Templates -> Add new template)
  2. Then put something like this as the template content:
    {scaffold:Product}
    h2. {text-data:Title}
    {text-data:Summary|type=area}
    
    *Unit Price:* {number-data:Price|decimal=true}
    *Shipping Cost:* {number-data:Price|decimal=true}
    {scaffold}
    
  3. Save the template with a name of 'Product Template'
Create the product page
  1. Now, add a new page
  2. As the page contents, put the following:
    {boilerplate:Product Template}
    
    Note!
    This is the name of the template, not the scaffold!
  3. Save the page (as, for example, 'Widget 1')
  4. Once it's saved, you'll be asked to enter the details for the 'Title', 'Cost' and 'Shipping' fields.
  5. Repeat ad-nausium for all of your products.

Update the original template

After a while, you decide you really want the costs to be listed before the summary. Also, you'd like to specify a release date.

  1. Edit the 'Product Template' template (Browse Space -> Templates -> Edit)
  2. Change the text to the following:
    {scaffold:Product}
    h2. {text-data:Title}
    *Unit Price:* {number-data:Price|decimal=true}
    *Shipping Cost:* {number-data:Price|decimal=true}
    *Release Date:* {date-data:Release Date|format=d MMM, yyyy}
    
    {text-data:Summary|type=area}
    {scaffold}
    
  3. Save your changes and check your product pages. You will need to edit them and fill in the release date for each.

See Also

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators