Advanced custom fields on structures

Learn how to add custom fields to WEMASY structure items and categories with the form builder, fill them in per item and use them in custom templates.

Custom fields add your own information to the items and categories of a structure. A team structure can get a job title and a phone number, a vacancy structure a salary and a location, a project structure a client name and a year. You build these fields once with the same drag-and-drop builder you know from Forms, and every item gets them.

Add fields to a structure

Website Builder: On the structure definition

  1. Click the three-dots menu next to Pages and click Structures.
  2. Open the structure.
  3. Find Items Custom Fields. For categories, use Categories Custom Fields, which appears when categories are enabled.
  4. Click Create Custom Fields. The form builder opens.
  5. Drag the field types you need from the left onto the form.
  6. Click a field to set its label and its key, for example job_title.
  7. Click Save in the form builder.
  8. Click Save on the structure form.

To change the fields later, click Edit Custom Fields in the same place. With Import and Export in the builder you can copy a set of fields to another structure.

Fill in the fields per item

  1. Click the structure in the bar above the canvas.
  2. Open an item, or create one with New Item.
  3. Open the Custom Fields tab.
  4. Fill in the values for this item.
  5. Click Save.

Categories work the same way, on the category form.

Show the values on your site

Custom field values are available in the templates of the structure. In a custom template, a developer refers to a field by its key, for example {{ acf.job_title }}. See Custom templates and code and Shortcodes in Website Builder.

Choose good keys

  • Use short, lowercase keys with underscores, such as reading_time.
  • Do not rename a key after items have values: templates and the importer refer to the key.
  • When you load items with the Importer, set up the structure and its fields before the first import.

Tip: write down what each field is for in its label, so everyone who adds items fills them in the same way. More about structures: Working with structures.

Put it to work
on your own website.

Start free with WEMASY and build your site in a few minutes.