Creating custom input forms

OpenWebCMS? comes with a very basic input form for content documents, which just contains a RichText? field. But you can create your own forms with every field and functionality you like, so that you can provider your users with different forms for different types of content.

creating a custom form

Custom forms are implementet as a subform. Open the OpenWebCMS? in Domino Designer, navigate to 'shared code\subforms' and create a copy of the '(ynDK_subForm_Standard)' subform via copy & paste.

Open the copy and rename it to '(ynDK_userSubForm_test)'. Add a field or do some other changes to the subform. Save it.

Open the OpenWebCMS? administration and add 'test' to the field 'basics -> 'custom forms'. Save the administration page.

Edit a content type (see (?Customizing Content types?)) and choose 'test' at the field 'subform for editors'. If you have already created content with this content type, choose 'Inherit values to content documents' to push the new subform to the existing content documents.

That's it. Now every content created from that content type will present your custom subform.

displaying fields from a custom form in the web

You can display the content of the fields of your custom form in the web by modifying a template. For example if you have the field 'cNewsDate' in your custom form, you can display it's content by using the following DML code in the PreDML or PostDML section of a template:

@ cNewsDate @

If the 'cNewsDate' field is from type date, you have to write:

@ @text(cNewsDate) @

Together with some HTML this could look like this:

News dated: @ @text(cNewsDate) @

handling RichText? fields

You can only use exactly one RichText? field on your custom form. And it has to be named 'RT'. The 'RT' field is being displayed between the PreDML and PostDML of a template.

naming conventions

Every field on your custom form except the RichText? field has to be prefixed with a 'c'.
Good field names:

  • cNewsDate
  • cTitle
  • cWhatever

    Bad, bad, bad field names:

  • NewsDate? (without the 'c')
  • title
  • category

    see also

  • Naming Rules for custom Elements