Skip to content

Craft Field Layouts

alinistrate edited this page Nov 28, 2026 · 1 revision

Craft field layouts and content

Editorial tools

Use menu fields for content shared by the whole menu, such as a footer tagline. Use node fields for content specific to an item, such as a service description or an image.

Configure the layouts

  1. In Craft, create or identify a reusable field under Settings → Fields.
  2. Open Olive Menus → Field layouts and choose Menu fields or Node fields.
  3. Add the field in Craft's field layout designer and save the layout.

Each layout applies across the project. Craft syncs these layout definitions through Project Config. An administrator can change them in environments that allow administrative changes. Field values are saved separately for each menu or item on its site.

Craft field layout designer with two custom menu fields

Edit field content

Choose the site in Olive Menus. Select Menu content in the menu editor, or open a saved item's settings and select Node content. Enter the values and select Save field content.

These saves update the live field content and record a revision. Publish or discard an existing menu draft before editing its live fields. For a new node, save or publish the node first. If another editor saves changes while this form is open, reload and reapply your intended changes.

Menu field editor with Introduction and Contact label values

Node field editor with a description and a short label for Strategy

Render content in Twig

Read the native field values from the menu handle. The optional second argument is the site ID. Add the item ID as the third argument to read a saved node's fields.

{% set menuContent = craft.olivemenus.getMenuContent('footerMenu') %}
{% if menuContent %}
    <p>{{ menuContent.getFieldValue('tagline') }}</p>
{% endif %}

{% for item in craft.olivemenus.getMenuData('footerMenu') %}
    {% if not (item.isDynamic ?? false) %}
        {% set nodeContent = craft.olivemenus.getMenuContent('footerMenu', null, item.id) %}
        {% if nodeContent %}
            <p>{{ nodeContent.getFieldValue('linkDescription') }}</p>
        {% endif %}
    {% endif %}
{% endfor %}

Use the field handles from your layout. Dynamically generated children use their linked entry's content. Use the Twig helper to read native field values. A site or item with no saved field content returns no element.

Clone this wiki locally