Shortcode for a box link that manually shows a box
To make it easier to generate a link in your posts or pages that shows or hides a certain box, we've included a shortcode in Boxzilla that generates the correct HTML for you.
Here's how to use it in its simplest form:
However, this generates the HTML for opening all loaded boxes on that page. Most likely, you'll want to open a specific box only.
For this, you will have to include a "box" argument. In the following example the box with ID 1234 will be opened when the link is clicked.
[boxzilla_link box="1234"]Open pop-up[/boxzilla_link]
The shortcode accepts several other parameters to modify the resulting HTML.
|box||ID of the box you want to target.|
|action||Possible values are "show", "hide", "toggle" and "dismiss".|
|class||The CSS classes you want to add to the link element.|
Here's a complete example for a button that toggles box 1234.
[boxzilla_link box="1234" action="toggle" class="button red css-classes"]Open pop-up[/boxzilla_link]