Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Free
  5. url

Field url

Version: Free.

Why this type

Dedicated type instead of text for links. Pro: responsive for per-breakpoint URLs. UTM placeholders pair well with button fields.

When to use

  • Button href, external asset, anchor link
  • Card or partner logo link
  • Fallback when a button object is not needed

Tips

Label plus target fit button better. Internal MODX pages often use relation or resourcelist.

Similar types

  • button for label + url + target
  • slug for path segments, not full URLs

Schema

json
{
  "name": "link",
  "type": "url",
  "label": "Link",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

URL string.

Section data

Key link in the section data:

json
{
  "link": "https://example.com/page"
}

Chunk example

html
<a href="{$link|escape}">Learn more</a>

Notes

Pro: responsive.

Common properties

For fields with name that are stored in the section data:

KeyTypeRoleCMP
tabstringGroup subtitle in the inspectoryes
width25–100Field width as % of the row (flex)yes
descriptionstringHint under the labelyes
defaultanyInitial value for a new sectionyes
activeboolfalse hides the field in the inspectoryes
requiredboolRequired on publish (draft still saves)yes

Pro (capability responsive): with responsive: true, the section data uses desktop, tablet, mobile keys instead of a scalar.

  • Also: showWhen, UTM placeholders \{\{utm:key\}\} in the URL string.

See fields overview.

See also