The Metadata Plugin
Metadata Management for Manila
 
Site last updated
2/24/2006; 12:33:21 PM
 
Home

Why

Features

FAQ

Updates

Documentation

Download

Developers

Bugs

Feedback

Discuss

Planned
Features

 
 

Custom Input Form Templates

Input form templates is a feature of the Metadata Plugin that allows you to lay out the page(s) where you enter metadata input. It does this in two ways:

  • you can modify the layout of the Edit this Page form, which is currently in a fixed format.
  • a new metadata macro, customInputForm, builds forms to set a selection of metadata values from any page.

My motivation for doing this work was to make tailored pages for data entry for naive users of Manila sites. The combination of the input form templates with the metadata Page Macro allows me to build Manila sites where each message is like a record in a FileMaker™ database.

How it works

To start with your customisation, first use the Manage Meta Types page (click on the metaData link in the Editors Only menu to get there) to create and order the metadata fields that you need. When you are done, look at the bottom of the Manage Meta Types page for the link called Build Input Form Template . Click that link and the page will refresh. You should now see a second link in parentheses called Current Input Form template.

If you follow that link you are presented with an ordinary Manila message that looks a little like the form you see when you edit a Manila page. Edit this message and you should find HTML to build a table with table cell items in brackets, such as

[[keywords]]

and

[[Banner("Yes")]]
[[Banner("No")]]

The first format is used to insert metadata form elements which cannot be broken up into separate html form elements; These are textbox, dropbox, dropbox limited and custom.

The second format is for metadata values whose individual values can stand as separate form elements: checkboxes, radio buttons and booleans.

You can change the layout of the form by changing this template. You can delete some fields from the form and/or reposition the elements to suit yourself.

The customInputForm macro works in the same way. Create a new message, enter a template using the [[metaname]] and [[metaname ("metavalue")]] formats, and then on any page, enter

{metadatamacros.customInputForm("shortcut")}

or

{metadatamacros.customInputForm(msgnumber)}

Hiding Fields

A bit more syntax

[[metaname, hidden("metavalue")]]

allows you to have the form contain a known value for a given metaname. It is inserted in the form as a hidden field and so is not visible to the end user.

Special Fields

Two fields are special - they are actually those used by Manila itself to create a new message/story or change a message/story. They are included in the custom template because you can play some very useful tricks with them.

Note : to keep Manila happy you MUST have fields called subject and text in the custom form.

But, if you wish to set the values of these fields to a constant value the user cannot change, you could use the hidden syntax. For example, you might want to set the text to the string

"{metadataMacros.page(\"templatename\")}".

With this technique you control the layout of the input form and the resulting page in terms of metadata variables.

Or, if you wish to generate the value of subject from a combination of metadata values, then you can use a trigger to do so.

See also Custom Input Forms.

By David Bayly

Comments...


This page last updated Thursday, February 6, 2003 at 4:39:32 AM. (19647)