3.2. Customizing Item Information Pages and Data Entry Forms

Table of Contents
3.2.1. Forms
3.2.2. Information Components

Once you have the defined a content type for your system, you can use the generic interface defined by the content management system for creating, editing and browsing items of that type. If the generic interface does not meet your requirements, you can customize part or all it to suit your needs.

The generic interface for content items includes three general types of templates, all located under /cms/modules/items:

3.2.1. Forms

The following generic data entry forms are generated by the system for any content type:

PageDescription
create-1Form to enter attributes for a new content item. The widgets displayed on the generic form are determined by the form metadata the developer has associated with attributes of the content type. Includes a radio selection allowing the user to pick a method for adding the body of the content item.
Signature:

parent_id: item ID of container item

content_type: content type of new item

content-add-1Form to upload or enter the body of a content item. Displays either a file upload widget or text area depending on user selection
Signature:

parent_id: item ID of container item

content_type: content type of new item

all other attributes from previous step (varies by content type)

revision-add-1Form to edit attributes of an existing content item. The widgets displayed on the generic form are determined by the form metadata the developer has associated with attributes of the content type. Includes a radio selection allowing the user to pick a method for editing the body of the content item.
Signature:

item_id: ID of the item

attributes-editForm to edit the attributes of an existing content item. Copies the content from the latest revision to the new revision.
Signature:

item_id: ID of the item

If a custom form is required, you may define it in /cms/modules/items/custom/<content_type>/ with the same name as specified above. If a custom implementation of the form exists, the system will redirect to it. Once the user has been redirected to your custom form, you may choose to implement any page flow desired before ultimately redirecting to the item information page.

See also the documentation on auto-generated forms.

3.2.2. Information Components

ComponentDescription
childrenList of links to child items of the current item. Includes a select widget to add a new child item of an appropriate type.
templatesLists templates currently associated with this item by user context. Includes a link to register-template to change template assignments.
permissionsLists permissions currently associated with this item. Includes a link to permission-add to add a new permission record.
related-linksLists offsite links related to this item. Includes a link to add marked offsite links (from anywhere in the Bookmarks tree) to the list.
related-itemsLists other items related to this item. Includes a link to add marked links (from anywhere in the Site Map tree) to the list.
workflow
  • Gives current workflow status (active, suspended, finished)

  • If a task is currently enabled, gives the name of the task and the deadline. If the current user is assigned to the task, gives a link to start the task.

  • If a task is currently underway (started), gives the name of the task, the name of the person undertaking the task, and the deadline if any. If the current user has started the task, gives a link to finish the task.

keywordsLists subject headings assigned to the content item. Includes a link to add marked subject headings (from anywhere in the Subject Headings tree) to the list.
revisionsLists the n most recent revisions to the item. Includes controls to change the sort order and number of revisions to be displayed, as well as links to view a revision in context.
journalLists all comments made on the item to date.
wizardsList of special tasks associated with a content item (defined by a custom component under custom/<content_type>/wizards).

Any of these components may be incorporated into a custom information page using the include tag in the page template:

    
    <include src="../../workflow" item_id=@item_id@>
        

Note that item_id is the only parameter required by the standard information components.

karlg@arsdigita.com

Last revised: $Id: custom-interface.html,v 1.1 2001/04/20 20:51:09 donb Exp $