Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

After creating a Content Type, you can extend it by adding Content Fields to it. Content fields have a name and an id. The name is used as the label above the field in the edit screens. The id is the key that is used as an attribute to call on the object variable in the theme files. In the example of the ‘Colored Button’ Content Type (Element Type), you could add a field for the background color of the button.

...

In the user’s edit screen for a colored button it would say ‘Background color of the button’ above the field. In the theme file (elements/colored_buttons/colored_button.plate) you would use colored_button.bg_color to call the value of the field on the object. In this case, colored_button being the object with the ‘Colored button’ Content Type, and bg_color being the field id and attribute name for the colored_button object.

Read the documentation on objects for more on how to call the attributes inside the theme files.

...

A field that gives the user access to the media library, where he can pick or upload new images, PDF’s and other attachments. Calling a media field object attribute returns an attachment object.

Choice field

This field gives the user one or more choices to choose from. You can add possible choices (predefined values), or pick a true/false choice option. The possible choice field kinds are:

...

Read all about references fields here.

Link field

The user can choose a post from a dropdown to link to, an attachment from the media library, or just type in a (external) URL.

...