This page last changed on Aug 31, 2011 by pwatson.

This page gives an example of a user macro, the 'NoPrint' macro, that you can use to prevent text from being printed. (For full details about creating a user macro, see the guide to writing user macros.)

Defining the 'NoPrint' User Macro

To create the 'NoPrint' user macro:

  1. Go to the 'Confluence Administration Console' and click User Macros in the left-hand panel.
  2. Click Click here to create a new User Macro at the top of the list of macros.
  3. Enter the macro attributes as follows:
    • Macro Name: noprint
    • Visibility: Visible to all users in the Macro Browser
    • Macro Title: NoPrint
    • Description: Hides text from printed output
    • Categories: Confluence Content
    • Icon URL: You can leave this field empty.
    • Documentation URL: You can leave this field empty.
    • Macro Body Processing: Render HTML
    • Output Format: HTML
    • Template:
      ## @noparams
      <div class="noprint">$body</div>
      
  4. Click Save.

Usage with the Wiki Markup Editor

What you need to type

What you will get in your printed output

Print {noprint}This text will not be printed{noprint} me.

Print me.

Making PDF Export Recognise the NoPrint Macro

See Advanced PDF Stylesheet Customisations#noprint.

Related Topics

Writing User Macros

Document generated by Confluence on Sep 19, 2011 02:42