Meta Box
Support › MB Views › Custom data in MB View ShortcodeResolved
Hello.
I would like to use MB View to display content of a specific post. I see it's possible to add custom data into the shortcode of the view, so is it possible to write the post ID in a custom data to filter for this post ?
My goal is to add this view into another post.
Thanks.
I tried this, but it gave me a fatal error {% set args = {{ ID }} %} {% set post = mb.get_post( args ) %} {{ post.post_title }}
Hi,
Please remove the double curly brackets if you assign a value to a variable. It is used to print out the value.
{% set args = my_post_id %}
and the shortcode should be [mbv id="your-view-id" my_post_id="123"]
[mbv id="your-view-id" my_post_id="123"]
You can follow the documentation to know how to use Twig https://twig.symfony.com/doc/3.x/templates.html