Dynamic fields
VX fields appear in the dynamic data picker under VX, grouped by where they read from:
| Group | Reads 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 field | In an image or video control | In a text or link control |
|---|---|---|
| Image, SVG | The image, at the size you choose in the element | Its URL |
| Gallery | All images in a gallery control, the first in an image control | The first image's URL |
| Video | The video | Its URL |
| URL | The video at that address | The address |
| Files | The first file, in an image or a video control | The 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.
Links
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 box | Does |
|---|---|
number_format|2 | 2 decimals |
currency_format|EUR | Formats as euros |
pluralize|review|reviews | "1 review" or "4 reviews" |
date_format|l, j F | Formats a date |
truncate|80 | Shortens to 80 characters |
uppercase | Capitals |
number_format|2:append| EUR | "12.50 EUR" |
count | How many rows or selections there are |
The box takes these modifiers:
| Group | Modifiers |
|---|---|
| Text | uppercase, lowercase, capitalize, trim, truncate, truncate_words, prepend, append, replace, slugify, strip_tags, pluralize |
| Numbers | number_format, currency_format, round, clamp, ordinal, abbreviate |
| Dates | date_format, date_modify, to_age, time_diff |
| Lists | list, count, first, last, nth, shuffle |
| Fallbacks | fallback |
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, typeBed & 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_modifiersandvx_image_index, which you can use in[breakdance_dynamic]shortcodes throughparams. - A URL field's
__videoentry passes the URL to the builder'sOembedData::fromOembedUrl(). A URL with no embed is returned as a direct video.