Encapsulating a button within a shortcode

Hi,

I am building a membership site with Pro & MemberPress, and I am trying to find a way to encapsulate a button (and/or other elements) inside the [mepr-show if=“loggedout”][/mepr-show] shortcode within the pagebuilder

ie [mepr-show if=“loggedout”] BUTTON GOES HERE [/mepr-show]

I was thinking of using a class (.publiconly) and the :before & :after css tags but can’t quite figure it out

Can you help please?

this would be an excellent solution (as suggested in this post > ) https://theme.co/apex/forum/t/feature-request-shortcode-wrapper/46293

Hello @scotbaston,

Thanks for posting in!

You may be able to resolve your issue by utilizing the button shortcode:

Your shortcode may look like this:

[mepr-show if="loggedout"][button type="real" shape="square" size="regular" href="#example" title="Example"][icon type="ticket"]Square Button[/button] [/mepr-show]

Hope this helps. Kindly let us know.

Thanks RueNel,

sadly in this case it will not work as it is a V2 button with subheadlines etc

it would be great to see an option similar to this > https://theme.co/apex/forum/t/feature-request-shortcode-wrapper/46293

or an advanced wrapper section (like advanced background) that allows pre and postfix shortcode to be added

Hello @scotbaston,

Yes that featured request is already added in our enhancements list. At the moment, there is no way you can implement it using the v2 elements.

Regards.

Thank you

although some people have suggested global blocks added as a shortcode between the membership shortcode

not elegant but it should work-ish

I’d really like to see that feature request implemented, and will look forward to it

No problem.
If you need anything else we can help you with, don’t hesitate to open another thread.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.