Accent Fields Text

URL

Text plus a format contract — must parse as http(s), judged by the platform’s URL parser.


Text input, plus a format contract: a string that must parse as an http or https URL. Same storage, same editor — one validation rule at the write boundary.

Declaring one

Label Booking link
Key booking_link
Data type string
Editor text_input
Validation url: true

The contract

The platform's own parser is the validator — the value must satisfy new URL(...) and carry an http: or https: protocol, which rules out javascript: and friends at the boundary rather than in every template that prints an href. Blank stays required's question, as with email.

<a href="<%= cms.asset.content.booking_link %>" rel="noopener">
  Book tickets
</a>

When not to use it

  • A link to another page on this site — that is a reference; a pasted internal URL goes stale the day the page moves.
  • A mailto or tel — those are their own schemes; store an email or a text phone field and build the scheme in the template.