Creating alternative forms for page 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 page type and use it in a properties dialog.

See Extending the page type listing filter for another practical example of using alternative forms in page types.

Adding an alternative form

In this example, you modify the field displayed in the Properties dialog used with the Document library web part. For this purpose, you can create an alternative form of the File page type and modify its fields.

  1. Open the Page types application.
  2. Edit () the File page 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 field 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 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 pages 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 Select.

    Selecting an alternative form

  7. Click Save & Close.

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

Configuring CMS File properties using the Document library web part

The Properties dialog without the file upload field