Questions tagged [template-directive]

Questions about template directives, used in CMS pages, static blocks and email templates

Filter by
Sorted by
Tagged with
0
votes
0answers
87 views

Magento 2 CMS Block: Is it possible to use another directive within translate directive?

For example I have a CMS block with a text I want to translate but I have a link inside this text that uses the {{store url=""}} directive. In my cms block: {{trans "Foo <a href="{{store url=""}}"...
0
votes
0answers
28 views

convert {{var}} in custom textarea

I have one textarea with some var that should be convert to text like hi {{var customer.getName() }} your order number is {{ var order.getId()}} how i can convert {{var}} ?
5
votes
2answers
277 views

Use CMS blocks inside product attributes

I want to use CMS blocks inside product attributes, eg in description and short description. inside product description I've added {{block id="test1"}}. i have two observer ...
0
votes
1answer
35 views

magento store url occurs twice on store 2 of 3

I am about to got nuts trying to figure this one out. I have 3 stores, camping, fishing and hunting all using the base URL with redirect to the store URL. i.e URL nilandtrading.com/fishing, but if I ...
3
votes
1answer
675 views

Magento best practices: try / catch in templates

I have a question about best practices in templates. Let's assume I am editing the product details template file. I would like to call a method in the product model which can raise an exception. ...
0
votes
1answer
99 views

For Locale other than english, themes does not get applied

I was having a configuration where the setup was like below Main Website ---->Store 1(store for XYZ sister company) ----> English Store View ---->Store 2(store for ABC ...
0
votes
1answer
439 views

Load static CMS block with directives

I created a block under CMS -> Static Blocks with the following content: <a href="http://www.foo.com"> <img src="{{media url="wysiwyg/email/751-footer.png"}}"/> </a> ...
2
votes
1answer
239 views

Custom CMS directives for Magento 2.1

I want to create a new directive to allow dynamic content to be added to CMS pages in Magento 2.1 I've found this article for Magento 1.7: Add new custom CMS template directive {{cdnmedia}} Can ...
4
votes
1answer
685 views

Block directive

I'm wondering how I can include a .phtml file inside my cms block. I came across Magento directives which say to use the following: {{block type="core/template" name="poop6" template="Magento_theme::...
1
vote
1answer
385 views

How to add CMS directive {{block}} on custom module field in Magento 2

I have developed a custom slider for Magento 2. The fields for my slider in the backend are; Title, Image and Content. The Content is a Wysiwyg editor and I am trying to make it work like a CMS Page ...
0
votes
2answers
439 views

Magento secure URL directive?

I'm using {{store url=""}} to build the URL for a CMS block. The block is later loaded within the HEAD tag to include a rel="stylesheet" link pointing to a CSS file. My problem is that the store ...
1
vote
1answer
72 views

{{skin url=“”}} is removed

I am facing a problem, whenever I am editing CMS page by using editor that time all of the {{skin url=''}} is being removed automatically. Can anyone please advice me some solution?
0
votes
1answer
356 views

How to access a current url of a magento cms pages which is created from admin panel?

http://magento.com/cms-page-identifier?a='jfls'&b='jhdgfjsd' I want access a query parameter (a and b values from url) in a magento cms page. Can some body help me the {{}} directives to print ...
3
votes
2answers
5k views

How to render widgets in product and category description in Magento 2?

In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before): {{widget type="Vendor\Module\Block\Widget\...
3
votes
2answers
3k views

Magento 2 how to add if or else statement to email template?

I want to add an if or else statement to the invoice email template to check if the order shipping method is courier delivery order or self pick up order. How can I do this?
0
votes
1answer
200 views

Template vars/placeholders

Relatively new to Magento and seeing a lot of this lately in (email) templates: {{template config_path="design/email/footer"}} {{depend order.getIsNotVirtual()}} {{layout handle="...
0
votes
2answers
913 views

How to write conditional statement using {{if}} in the content of CMS page in admin side?

I want to show two different contents of a cms page (e.g. about us) in two different themes. I know it can be possible if I create a template where I can have the theme specific condition and include ...
0
votes
1answer
140 views

since SUPEE-6788 shop name is missing in Emails

hi we have an email template for our orders with this subject {{block type="imprint/field" value="shop_name"}}: Rechnung Nr. # {{var invoice.increment_id}} für Bestellung Nr. # {{var order....
2
votes
1answer
7k views

If Condition with “==” in Email Template {{depend}}

I am using simple if condition in email template. {{depend order.delivery_time=="1"}} Delivery Time: 10am To 2pm {{/depend}} {{depend order.delivery_time=="2"}} Delivery Time: 2pm To 7pm {{/depend}} {...
44
votes
3answers
14k views

APPSEC-1057 How to add variables or blocks to the white list tables

APPSEC-1057 (part of SUPEE-6788) states Magento now includes a whitelist of allowed blocks or directives. If a module or anyone uses variables like {{config path=”web/unsecure/base_url”}} and {{...
4
votes
1answer
919 views

Is it possible to add child blocks to a block that has been defined in a static block?

In layout.xml you can define children like this <block...><block... /></block> Is the same possible if I add a block in a static block? I only know this notation: {{block type="...
7
votes
2answers
5k views

Using variables within CMS Static Blocks with {{depend}}

I have used the {{depend}} template functionality before using email templates and I am wondering if this is possible within CMS Static Blocks, for example: <a href="{{store url='customer/account'}...
4
votes
1answer
1k views

Magento 1.9 Google Analytics template not loading

Why isn't my ga.phtml file loading on the live site (but does load on my dev site)? After upgrading from 1.6 to 1.9, my Magento site has stopped tracking in Google Analytics. After doing some ...
3
votes
2answers
395 views

Where is the code for “{{store url=”example/example"}}

I would like to know how Magento converts {{store url="example/example"}} into http://www.example.com/example/example/
1
vote
1answer
1k views

Use helper function to cms block

I am trying to add helper function to cms block or page but it didn't parse like other directives.can anyone help to resolve this issue.or how make helper directive to work in cms block or cms page. ...
1
vote
2answers
1k views

I get code while displaying terms and conditions in checkout onepage

I created a terms and conditions page via Sales > Terms and Conditions, I created a terms page and content as {{block type="cms/block" block_id="terms"}}. I also created static block from CMS >...
0
votes
6answers
4k views

E-Mail template/variables - taxvat

I need to add the taxvat id into the order confirmation E-Mail but I can´t get it to work. There is a block {{var order.getBillingAddress().format('html')}} and I´ve added <br/>{{var customer....
1
vote
1answer
170 views

what does the 'depend' key word mean?

I see in the admin panel this code {{depend prefix}} {{/depend}}: What does it mean?
5
votes
1answer
2k views

Passing variables into a CMS block

I have a cms block that is added to a page via layout xml. <block type="cms/block" name="my_cms_block" as="my_cms_block"> <action method="setBlockId"> <block_id>...
1
vote
1answer
668 views

How to Insert Page Info on Email Form?

I'm using the same form for a few pages. {{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}} Is it possible to somehow detect from ...
21
votes
1answer
22k views

Depend and if/else in transaction emails in Magento 1

we are investigating some checks in our transactional emails or newsletters and looking at http://merch.docs.magento.com/ce/user_guide/store-operations/email-transactional.html where we find the code ...
7
votes
2answers
33k views

Why do we have to use “store” for links in CMS like <a href=“{{store url='home'}}”>home</a>

To insert links in the CMS, we use this code: <a href="{{store url='home'}}">home</a> What is this "store" keyword doing and why is it called "store"? And are there any other keywords ...
5
votes
2answers
4k views

Is It Possible To Create My Own Shortcode

I'm building a module. I want to be able to use a shortcode (template directive) in my CMS static blocks, such as the following: {{store url=""}} I want to call my own module's frontpage blocks ...