Comala Workflows is now Comala Document Management. Click here for the latest documentation.

Overview

The {set-metadata} macro is used to define metadata key=value pairs which are stored at the content-level (page or blog post).

The values can later be retrieved via the {get-metadata} macro, or any other plugin capable of reading metadata. In addition, the values can be used as Value References in any macro or feature which supports them.

Where to use it?

Optional.

One or more {set-metadata} macros can be put in a {trigger} macro.

Parameters

Parameters

Required

Default

Notes

first unnamed
parameter

(tick)

 

The metadata key (name by which the value can be accessed).

  • Character restrictions?
macro body

The metadata value

trim


true

Should the macro body contents be trimmed (remove whitespace)?

  • true – yes, trim (recommended)
  • false – no, leave as is

page


 current page

Where should the metadata be stored (default = current page)?

  • @parent – store on the parent page, not the current page
  • @children – store on child pages, not the current page

Note: This parameter only works on pages, not blog posts.

Basic example

{workflow:name=Store metadata}
   {state:Test}
   {state}
   {trigger:pagecreated}
      {set-metadata:Document Author}
         @user@
      {set-metadata}
   {trigger}
{workflow}

Note: This example requires Space Mode for the pagecreated event to work.

...retrieving later:

You can either use the {get-metadata} macro, if you want to output the value in normal wiki contnet (or a macro that supports such content):

This document was created by:
 [~{get-metadata:Document Author}]

Or a Value References (if applicable):

This document was created by:
 [~@Document Author@]

All examples

See also

Workflow Authoring Guide:

Integration Guides: