Web UI

HOWTO: Create and Reuse a Custom element

This page is scheduled for review and update. Check back soon for updated content!

In this tutorial you will learn how to create and reuse custom elements in Studio Designer.

Watch the related courses on Nuxeo University:
Expert Session on Nuxeo Elements Creation
Course on Web UI Stack


Create an Element

We are going to start by adding a validation schema to our Contract document type.

To create a validation schema:

  1. In Studio Modeler, go to Configuration > Content Model > Schemas.
  2. Click on New and name it validation.
  3. Add a field validated as a boolean.
  4. Save your changes.

To insert the validation schema in the Contract document type:

  1. In Studio Designer, go to the UI tab.
  2. In Layout Blocks, at the bottom-right of the screen, click on to create a new element.
  3. Enter the name my-validation-element and select Title/description element template as element template.
  4. Edit the layout of the element by adding the validation schema.
  5. Switch to the Code Editor at the bottom of the main view and replace the lines describing the title and description by the following to call your validation element:
     <div role="widget">
         <paper-checkbox checked=""></paper-checkbox>
  6. Save your changes.

Reuse an Element

Now, go to your contract document type, on the view layout to use your element:

  1. Click on Configure.
  2. Switch to the Code Editor. On the search available in the elements catalog, search my-validation-element.
  3. Drag and drop it from the catalog to the editor.
  4. Save your changes and deploy your studio project, you're done :)

    You can now reuse your element as much as you want, for example on the other layouts of your contract document, it will always be available in the Project Elements library.

4 months ago manonlumeau Update page to reflect JSF UI deprecation
History: Created by manonlumeau

We'd love to hear your thoughts!

All fields required