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 belonging to the current page — for example a production's running time, a venue's capacity, or any extra detail you've 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 value is read from the page the block sits on, so the same block shows a different value on each page it appears on. Place it once in a template, and every page built from that template fills in 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 colour 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, and use spacing and padding on that container to set the room around it.

Example: show a running time

To display a production's running time labelled "Duration", with a fallback for productions still being 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