Bricks
3 min read
With Bricks 1.x active, every field becomes a dynamic data tag you can use anywhere Bricks accepts dynamic data. This is free.
Pick a tag
In a Bricks text, heading, link or image setting, open the dynamic data picker and choose from the group WPM Fields. Entries are named "Field group › Field", for example "Product details › Price", and insert a tag such as {wpmcf:product_details.price}. Every active field with a value (except Password and layout fields) is listed.
You can also type tags yourself in any text:
Tag | Result |
|---|---|
| The value as escaped plain text |
| The field type's own escaped markup (a Link as an |
| A sub-field of a Group (or Clone) field |
| A sub-field of the first row of a Repeater or Flexible content field |
Tag names use lowercase letters, digits, _ and -, joined by dots; an optional :html ends the tag. Tags that Bricks or other plugins define ({post_title}) are left alone.
Heading: {wpmcf:product_details.name}
Text: From {wpmcf:product_details.price} EUR
Text: {wpmcf:product_details.specs:html}Links and images
- In a link setting, a tag gives the field's URL: a Link field's address, a URL field, an Email as
mailto:, a File or Image as the file address, a Page link or Post object as the permalink. A field with nothing to link to gives an empty address. - In an image setting, a tag of an Image or Gallery field gives the image (the first image of a Gallery). Bricks receives the attachment, so it builds sizes itself. For a text setting that needs an image address, the tag prints the image URL.
Query loops and the current post
The value comes from the post Bricks is rendering. Inside a Bricks query loop, that is the post of the current loop item, so a loop over products can print each product's price. Options page groups need no post. The visibility rules in the Page builders overview apply to values of other posts.
Escaping
Plain tags are escaped for HTML, so Head & "q" prints as text. Use :html only for field types that produce markup; its output is escaped by the field type.
Troubleshooting
- The WPM Fields group is empty. Check that field groups are active and have fields with values; Bricks must be active (the integration registers once the theme has loaded).
- A tag prints nothing. The field is empty on that post, the reference is misspelled (
group.field), the field is a Password, or the tag is in a setting where Bricks does not run dynamic data. - A tag appears literally on the page. The reference does not match the pattern (check dots and
:html). Unknown fields print nothing, so a literal tag usually means the tag was not recognized aswpmcf:data. - Nothing works after repeated errors. Check WPM Fields › Settings › Health; an integration that fails five times in ten minutes is switched off until you turn it on again.
Still stuck? Contact support