add attributes to mb views shortcode

Support MB Views add attributes to mb views shortcodeResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23123
    Marek LangeMarek Lange
    Participant

    Hi,
    I wonder is it possible to extract shortcode attributes in mb-view template editor.
    For example using [ mbv id="3000" foo="bar" ]

    I have tried:
    {% mb.shortcode_atts(array('foo'=>'default'), $atts); %}
    but it breaks wordpress. My knowledge of twig is minimal and i cant find good examples beside simple loops or printing values.

    Finally i want to pass category id to view by shortcode attribute. To reuse template for different content, same look. Is there a better way to do it? Shortcodes will be used in elementor page.

    Thank you.

    #29203
    JasonJason
    Participant

    I would also like this feature.

    #29205
    Long NguyenLong Nguyen
    Moderator

    Hi guys,

    The attributes can be added in the View shortcode, please update the plugin and follow the documentation https://docs.metabox.io/extensions/mb-views/#custom-data

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.