Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Shortcodes: Contact Box, Price and Button in the CMS

Magento 2 Extension Hyvä Ready Magento 2.4.x

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
Auf Lager
€99.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

6 Features

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 shortcodes

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.

01Parser and syntax

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
CMS › Edit page
Input[button text="Ask now"] (example)
Outputfinished button
Unknownstays text
Blocks
contactContact box
price sku=...Product price
buttonButton
02Building blocks

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
03Cache and performance

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
Cache settings
Price blocktag cat_p_{id}
Contact boxtag config
Parseron match only
Stores › Configuration › Mironsoft › CMS Shortcodes
Parser active inpages, blocks, blog
Contact boxactive
Button variantdefault
04Admin reference

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
Use cases

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.

Comparison

Magento 2 Shortcodes: without and with the module compared

The difference to widget syntax and pasted HTML.

TopicWithout moduleWith Mironsoft CMS Shortcodes
InsertingWidget syntax or pasted HTMLShort placeholder in square brackets
MaintenanceChange every page individuallyChange the block once, all pages follow
PricesTyped by hand, quickly outdatedBy SKU, current thanks to cache tag
EditorsNeed technical knowledgeReference with copy-ready examples
SecurityUnchecked HTML in the editorParameters sanitised and escaped
Setup

How we set up Magento 2 Shortcodes for you

The process after you place the order.

1

Agreement

We clarify which areas use the parser and which blocks your editorial team needs.

2

Installation

We install the module and activate Magento 2 Shortcodes for pages, blocks and blog. Then we check the output in your Hyvä theme.

3

Adapt the blocks

We style contact box and button in the look of your shop. If you wish, we add custom blocks.

4

Testing

We test cache, price changes, unknown brackets and several store views.

5

Handover

Your editorial team receives the reference and a short introduction.

Differences

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.

05How the purchase works

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.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Everything important about syntax, blocks, cache and how the purchase works.

How can I use shortcodes in Magento 2?
Editors type a placeholder in square brackets in the CMS editor, for example for a contact box. On delivery the module replaces it with the finished block.
How can I insert a price into a text with a shortcode in Magento 2?
With the price block and the SKU of the product. The output shows the current price and marks itself for the cache.
How can I insert a contact box in the Magento 2 CMS?
The contact box shortcode reads phone, email and opening hours from the shop configuration. A change there applies on all pages.
Do Magento 2 Shortcodes work in the blog too?
Yes, the parser can be activated individually for CMS pages, CMS blocks and blog posts.
What happens to square brackets that are not shortcodes?
Unknown brackets remain ordinary text. Only registered names are replaced.
Are there problems with the page cache?
No. Price blocks carry the product cache tag, the contact box the configuration tag. Changes clear only affected pages.
Can I add my own shortcodes?
Yes. A block consists of a small class and a template and is registered in the registry. We implement it for you if you wish.
Are Magento 2 Shortcodes safe?
Parameters are sanitised and escaped so no unchecked HTML or script is output through a placeholder.
Does it work with Hyvä?
Yes, the output is plain HTML with Tailwind classes, without jQuery, Knockout or extra JavaScript.
Can I download and install the module myself?
No. This offer is not a download product. After the purchase we install and configure the module personally in your shop.
Write Your Own Review
You're reviewing: Magento 2 Shortcodes – Mironsoft CMS Shortcodes
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 Shortcodes – Mironsoft CMS Shortcodes

Magento 2 Shortcodes – Mironsoft CMS Shortcodes

€99.00