Hi buddies,
After introduce to you almost Communication Tools in Magento 2 site such as Email, Newsletter, Sale Documents, etc; we will goto the final part – Markup Tags.
Markup tags are macro codes that have a special meaning in Magento. They typically look like text surrounded by double curly braces. Markup tags can be used in CMS pages, static blocks and in email templates. For example, rather than hard-coding the full path to a page, you can use a markup tag to represent the store URL. The markup tags featured in the following examples include:
Store URL
The Store URL markup tag represents the base URL of your website, and is used as a substitute for the first part of a full URL, including the domain name. There are two versions of this markup tag: One that goes directly to your store, and the other with a forward slash at the end that is used when a path is added.
|
The dynamic media URL markup tag represents the location and file name of an image that is stored on a content delivery network (CDN). The tag can be used to place an image on a page, block, banner, or email template.
|
The Block ID markup tag is one of the easiest to use, and can be used to place a block directly on a CMS page, or even nested inside another block. You can use this technique to modify a block for different promotions or languages. The Block ID markup tag references a block by its identifier.
|
A template tag references a PHTML template file, and can be used to display the block on a CMS page or static block. The code in the following example can be added to a page or block to display the Contact Us form.
|
The code in the next example can be added to a page or block to display the a list of products in a specific category, by category ID.
|
Custom Variable
The Variable markup tag can be used to insert a custom variable into an email templates, blocks, newsletters, and content pages,
|
The Widget tool can be used to display lists of products, or to insert complex links, such as one that goes to a specific product page, based on product ID. The code that is generated includes the block reference, location of the code module, and corresponding PHTML template. After the code is generated, you can copy and paste it from one place to another.
The code in the following example can be added to a page or block to display the list of new products.
|
The code in the next example can be added to a page or block to display a link to a specific product, by product ID.
|
How to use Markup Tags in Link?
You can use markup tags with HTML anchor tags, and link directly to any page in your store. The link can be incorporated into content pages, blocks, banners, or email and newsletter templates with the 3-steps Process:
Step 1: Identify the Destination URL
Step 2: Add the Markup to the URL
Step 3: Complete the Anchor Tag
To help you understand more about this process, we will have a simulation by using Store URL in link with http://mystore.com/apparel/shoes/womens
{{store url=’apparel/shoes/womens’}}
Easy As Pie Login Using Social Accounts for Your Customers!
Explore Magestore Social Login for Magento 2 >>>HERE<<<
Your Magento website needs a powerful Magento ERP for stock control.
DON'T MISS THE CHANCE!