Magento 2 Shortcodes: Contact Box, Price and Button in the CMS
SKU: CMSSHORTCODES1
- short placeholders in square brackets instead of long widget syntax
- contact box, product price, button and more blocks in CMS and blog
- parameters such as product SKU, text or link directly in the shortcode
- admin reference with examples, cache safe and no extra JavaScript
Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.
Magento 2 Shortcodes: insert content with one placeholder
With the Mironsoft Magento 2 Shortcodes, editors insert building blocks into CMS pages, CMS blocks and blog posts by typing a short placeholder in square brackets. An entry such as contact box, product price or button becomes the finished HTML block in the design of your Hyvä theme when the page is delivered. The long widget syntax with type, template and block ID is no longer needed. The shortcodes work server side, need no extra JavaScript and are compatible with the page cache.
Short placeholders
One entry in square brackets replaces multi-line widget instructions.
Contact box
Phone, email address and opening hours from the shop configuration as a finished box.
Product price
The current price of a product by SKU, including special price and currency.
Button
A styled button with text and link, available in two variants.
Parameters
Texts, SKU, link or colour variant are given directly in the placeholder.
Admin reference
An overview lists all shortcodes with parameters and a copy-ready example.
Why Magento 2 Shortcodes make editorial work easier
The Magento standard editor knows widgets, but their syntax is bulky for editors. Anyone who wants to place a contact box or a price in a guide must know widget type, template and parameters. That is why merchants search for Magento 2 Shortcodes, a Magento 2 shortcode extension or placeholders in the CMS.
With Magento 2 Shortcodes the text stays readable: the editor holds only a short placeholder and the output is maintained centrally. If the phone number or the button style changes, you adjust the block in one place and all pages follow.
Magento 2 Shortcodes: syntax, parameters and safe output
A shortcode consists of a name and optional parameters in square brackets. The parser runs when CMS pages, blocks and blog posts are delivered and replaces every known placeholder. Unknown brackets stay as text so ordinary content is not destroyed. Parameters are sanitised so no malicious code can reach the output through the editor.
- Name plus parameters in square brackets
- Unknown brackets remain unchanged
- Parameters are sanitised and escaped
Contact box, price and button: bundled Magento 2 Shortcodes
Three blocks are ready to use. The contact box reads phone, email and hours from the shop configuration. The price block fetches the current price including special price by SKU. The button creates a styled link with text and variant. Custom blocks can be added as a small class with a template; the registry accepts them without any change to the parser.
- Contact box from shop configuration
- Price by SKU with currency
- Button with text, link and variant
Magento 2 Shortcodes and the page cache: no stale prices
Prices change while pages stay in the cache. The price block therefore marks its output with the product cache tag. If you change the price or a special price expires, only the affected page is rebuilt. Static blocks such as the contact box hang on the configuration tag. The parser only works when a square bracket block appears in the text, so normal pages cost hardly any time.
- Cache tag per product for prices
- Configuration tag for the contact box
- Parser runs only when brackets are present
Admin reference and settings for your Magento 2 Shortcodes
In the admin a reference page shows all available shortcodes with description, parameters and a copy-ready example. You switch blocks off individually, define the areas in which the parser is active (pages, blocks, blog) and pick the default colour and default text of the button. Editors therefore need no training in widget syntax.
- Reference page with copy-ready examples
- Blocks and areas switchable individually
- Default values for the button
Where Magento 2 Shortcodes help in everyday shop work
Typical situations in which a placeholder saves time.
Guides with a buying hint
In the guide text a shortcode shows the current price of the recommended product. The number is always up to date.
Contact box under texts
The same contact box sits on landing pages, help pages and in the blog. A new phone number applies everywhere.
Consistent buttons
Editors place buttons in the shop design without knowing HTML or classes.
Several languages
The placeholder stays the same, the output follows the store view. You do not have to copy a block per language.
Magento 2 Shortcodes: without and with the module compared
The difference to widget syntax and pasted HTML.
| Topic | Without module | With Mironsoft CMS Shortcodes |
|---|---|---|
| Inserting | Widget syntax or pasted HTML | Short placeholder in square brackets |
| Maintenance | Change every page individually | Change the block once, all pages follow |
| Prices | Typed by hand, quickly outdated | By SKU, current thanks to cache tag |
| Editors | Need technical knowledge | Reference with copy-ready examples |
| Security | Unchecked HTML in the editor | Parameters sanitised and escaped |
How we set up Magento 2 Shortcodes for you
The process after you place the order.
Agreement
We clarify which areas use the parser and which blocks your editorial team needs.
Installation
We install the module and activate Magento 2 Shortcodes for pages, blocks and blog. Then we check the output in your Hyvä theme.
Adapt the blocks
We style contact box and button in the look of your shop. If you wish, we add custom blocks.
Testing
We test cache, price changes, unknown brackets and several store views.
Handover
Your editorial team receives the reference and a short introduction.
Differences to widgets, CMS blocks and the blog module
Magento widgets and CMS blocks remain fully intact; Magento 2 Shortcodes do not replace them but offer a shorter notation for frequent building blocks. The Mironsoft blog module can use the parser for post content as well, if you wish.
The module delivers finished HTML on the server. In the Hyvä theme it needs neither Alpine.js extensions nor an additional library.
No download, but a personal setup
CMS Shortcodes is not listed here as a finished download to install yourself. The purchase is a commission: we contact you after the order, install the module in your shop and agree on blocks and areas together with you.
Frequently asked questions
Everything important about syntax, blocks, cache and how the purchase works.
How can I use shortcodes in Magento 2?
How can I insert a price into a text with a shortcode in Magento 2?
How can I insert a contact box in the Magento 2 CMS?
Do Magento 2 Shortcodes work in the blog too?
What happens to square brackets that are not shortcodes?
Are there problems with the page cache?
Can I add my own shortcodes?
Are Magento 2 Shortcodes safe?
Does it work with Hyvä?
Can I download and install the module myself?
Magento 2 Shortcodes – Mironsoft CMS Shortcodes