Skip to content

Dynamic fields ​

VX fields appear in the dynamic data picker under VX, grouped by where they read from:

GroupReads from
Post: …The current post
Author: …The post's author
User: …The logged-in visitor
Term: …The current term
Option page: …An option page

Fields inside a Group or Repeater show their path in the label: "Team > Name".

The picker only lists fields that fit the control you're on. An image control lists images, and a link control lists URLs. That's why one VX field can appear more than once, in different controls, under the same name.

Images and other media ​

VX fieldIn an image or video controlIn a text or link control
Image, SVGThe image, at the size you choose in the elementIts URL
GalleryAll images in a gallery control, the first in an image controlThe first image's URL
VideoThe videoIts URL
URLThe video at that addressThe address
FilesThe first file, in an image or a video controlThe first file's URL

Audio fields output their URL in text and link controls.

In a text or link control, use Output to choose another part of the file: alt text, title, caption or ID, and duration for audio.

To show another image from a Gallery in an image control, set Image number: 2 is the second image. Inside a loop over the gallery, the control shows the row's image.

Videos from a URL ​

Bind a URL field to a video control to play what it links to. A link to a service WordPress can embed, such as YouTube or Vimeo, plays in that service's player. Any other link plays as a video file.

The builder gets that player from the service each time it generates the page, which sends the service the video's address and your site's address. A page cache keeps this from slowing visits down. Visitors then load the player from the service, like any embedded video.

Choices ​

A Select, Radio Buttons or Button Group outputs the label ("United Kingdom"). Set Output to Value for the stored value (uk).

Checkboxes and Multiselect output the first selected label. Fill in Join all with to list every selection, for example , for "Wi-Fi, Parking, Terrace".

Lists without a loop ​

A repeater's sub-field used on its own is the first row. To use every row, fill in Join all with. For a block per row, use a loop.

URL fields work in link controls directly. Email and Phone fields do too, and open the visitor's mail or phone app.

To link to a related entry, use its own field, such as Writer > Permalink. In a relation that allows several items, that's the first one.

Formatting ​

Date, Time and Date & Time fields have a Format control. Pick a format, or Custom to type your own in PHP date format.

Every text field has the builder's own Prepend, Append, Limit Characters and Fallback under Advanced.

For anything else, use the Modifiers box. Each modifier is a name followed by its arguments, separated with |. Separate several modifiers with :, and they run left to right. The Modifiers reference explains what each one does: .number_format(2) there is number_format|2 here.

A colon inside an argument stays part of it, as in replace|10:00|noon. If the word right after a colon is a modifier's name, a new modifier starts there.

With Join all with, a modifier runs on each item before they're joined: uppercase capitalizes every name. The list modifiers list, count, first, last, nth, shuffle and pluralize work on the whole list.

In the Modifiers boxDoes
number_format|22 decimals
currency_format|EURFormats as euros
pluralize|review|reviews"1 review" or "4 reviews"
date_format|l, j FFormats a date
truncate|80Shortens to 80 characters
uppercaseCapitals
number_format|2:append| EUR"12.50 EUR"
countHow many rows or selections there are

The box takes these modifiers:

GroupModifiers
Textuppercase, lowercase, capitalize, trim, truncate, truncate_words, prepend, append, replace, slugify, strip_tags, pluralize
Numbersnumber_format, currency_format, round, clamp, ordinal, abbreviate
Datesdate_format, date_modify, to_age, time_diff
Listslist, count, first, last, nth, shuffle
Fallbacksfallback

To show something conditionally, use the Dynamic Data condition.

Limits and gotchas ​

  • Values are escaped for the page, so HTML in a text field shows as text. Rich Text fields keep their formatting.
  • The Dynamic Data condition compares that escaped value, so to match Bed & Breakfast, type Bed & Breakfast.
  • In the builder, a field with no value on the previewed item shows as its raw shortcode. On the page it's empty.
  • Inside a loop, most fields read the current row. Outside one, they read the current post.
Technical details for LLMs
  • Slugs are the field's key path: vx_tagline, vx_team_name, vx_user_phone, vx_term_hours.
  • Extra entries for a field take a double-underscore suffix, and are never used by a key: vx_logo__url, vx_photos__image, vx_mail__link, vx_photos__loop, vx_website__video.
  • When two post types use one key for different kinds of field, the first keeps the plain slug and the other takes __as_ and its type: vx_photo__as_image.
  • Controls are stored as the attributes vx_output, vx_date_format, vx_date_format_custom, vx_separator, vx_modifiers and vx_image_index, which you can use in [breakdance_dynamic] shortcodes through params.
  • A URL field's __video entry passes the URL to the builder's OembedData::fromOembedUrl(). A URL with no embed is returned as a direct video.

Documentation for the VX Framework.