Creating alternative forms for document types

The alternative forms allow you to create alternative representations of existing forms, which you can then use in different situations. You will find more information in Creating alternative forms. In Code names of automatically used alternative forms, you can learn about special code names of alternative forms. If you create an alternative form with one of these names, it will be used automatically in the given situation.

You can also create alternative forms for other objects in the following Forms application and in the Custom tables application:

This example will show you how to create an alternative form for the File document type and use it in a document properties dialog.

Adding an alternative form

You want to modify the Document properties form used with the Document library web part. For this purpose, you can create an alternative form of the File document type and modify its fields.

  1. Open the Document types application.
  2. Edit () the File document type.
  3. Switch to the Alternative forms tab.
  4. Click Create new form.
  5. Type the name of the new form.
  6. Click Save.

The system creates a new alternative form.

Configuring the alternative form

After you create an alternative form, you can change its fields using the field editor.

  1. Switch to the Fields tab.
  2. Modify the fields as you desire. For example:
    1. Select the FileAttachment field.
    2. Disable the Display attribute in the editing form check-box.

      Modifying the fields in an alternative form

    3. Click Save.
    4. Select the FileDescription field.
    5. Change the Form control type to Text box.
    6. Click Save.

The alternative form is ready to be used.

Using the alternative form on the live site

You can use the alternative form to change the appearance of the Document properties dialog used with the Document library web part.

Another example of the usage of the alternative form in a web part is the Contribution list web part. In this web part, you can define documents that visitors are allowed to create on the live site.

  1. Open the Pages application.
  2. Place the Document library web part.
    1. You can also use the example on the Corporate site -> Examples -> Web parts -> Document library -> Document library page.
  3. Switch to the Design tab.
  4. Configure the Document library web part.

    Configuring the Document library web part

  5. Click Select next to the Document form field.
  6. Choose the CMS.File class and the alternative form you have created and click OK.

    Selecting an alternative form

  7. Click OK again to close the Web part properties dialog.

If you now click (...) next to a document name and select Properties, the system displays the Document properties dialog without the file selection field.

Configuring CMS File properties using the Document library web part

Configuring CMS File properties without the File selection field shown