Basker Docs

Custom attribute

Display the value of one custom field from the current page's content on the page.

The Custom Attribute block prints the value of a single custom field that belongs to the current page. Examples include a production's running time, a venue's capacity, or any extra detail you have added to that content type. Use it inside a page or template where you want one specific value to appear in the flow of the content.

The block reads the value from the page it sits on, so it shows a different value on each page it appears on. Place it once in a template, and every page built from that template supplies its own value.

The field has to exist first

This block can only show a custom field that has already been added to the page's content type. If no extra fields are defined for that type, there is nothing for the block to display. See Custom attributes for how to add them.

Content

  • Attribute: the custom field whose value to show. Pick from the fields defined for the current page's content type. Required.
  • Label: text shown alongside the value, such as a caption or heading. Leave empty to show the value on its own.
  • Fallback Text: shown in place of the value when the field is empty on the current page.

If the selected field has no value on a given page and you have not set Fallback Text, nothing is shown.

No layout controls

This block has no Settings tab, so there are no width, spacing, background, or color controls of its own. It takes its appearance from the surrounding content and the theme. Wrap it in a Group or another container block to position or space it. Use spacing and padding on that container to set the room around it.

Example: show a running time

To show a production's running time labeled "Duration", with a fallback for productions not yet scheduled:

Add the block

Add Custom Attribute to the page or template.

Pick the field

Set Attribute to the running-time field defined for that content type.

Add a label and a fallback

Set Label to Duration and Fallback Text to TBC. Pages with a running time show the label and value. Pages without one show the label and TBC.

Where to go next

On this page