I have a section template that uses a query loop, I would like to assign a query parameter via the short code [bricks_template id=“1234” location=“phuket”]
Until this is solved, the work around I found was to just add custom fields to the post in question, then reference those custom fields in the template. If you need to dynamically update the template in code, updating the custom fields would accomplish the desired result?
I am also wondering why there is no solution for a problem that seems so simple.
Bricks automatically creates a Shortcode for all Templates created.
Shortcodes have $atts in WordPress, a feature that makes them useful at all.
How can I access these $atts in Bricks Builder ?
Again: Can someone from the Bricks builder team at least comments on this?
I guess this will be solved with the new “partials” elements. But for now, it’s still in development - so we have to wait.
What you can do is: create a (PHP) shortcode yourself and call the template inside this shortcode.
Now you can use PHP var’s inside the templates to show content given by the shortcode attributes.
I think this is now supported in 1.10. You can read more here under the Key-value pair arguments & Interaction conditions sections Dynamic Data – Bricks Academy
I build the site in Bricks, but the content is created as classic Wordpress posts using the Gutenberg editor.
Is it possible to create a component that can be used by an operator who creates an post from within the Gutenberg editor? That is, in some cases, in some posts, the operator needs to embed a component with some text (any text, depending on the operator’s need) and this will be displayed in the Bricks component? Is this possible using components?
Because the template can embed using shortcode, but just lacks the ability to simply pass the text (content).