Dynamic Shortcode

Support MB Views Dynamic Shortcode

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38024
    Wojtek PiskorzWojtek Piskorz
    Participant

    Hi.

    Inside of my singular template for CPT I need to create a dynamic shortcode. Is it somehow possible?

    Structure would be smth like this f.e

    <section>
    <h1>
      {{ post.title }}
    </h1>
    <div>
      [custom_name id="{{post.id}}"]
    </div>
    </section>

    Thanks!

    #38034
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Yes, it is possible. You can add any shortcode to the View content to render it on the frontend.

    #38039
    Wojtek PiskorzWojtek Piskorz
    Participant

    Using simple shortcode is self-explanatory. I need to create a "template" shortcode that would change based on post ID

    Backend

    Frontend

    #38052
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Yes, that kind of shortcode works as well on my demo site. Can you please replace the variable post.ID with a real/example post ID and recheck this issue?

    [bricks_template id="123"]

    #39404
    AnLipAnLip
    Participant

    Hi.
    Can't help but to duplicate my demand from https://support.metabox.io/topic/mb-view-gridbuilder-card/ to here since it implies roughly the same thing : using dynamic data in a shortcode.
    So I'm trying to use a MB View shortcode to display a View in a WP GridBuilder card. I was told I need to pull the post's ID to make it work, but it doesn't at the moment.

    Here is the shortcode as I have it : [mbv name="wpgb-card-meta" post_id="{{ post.id }}"]

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