Questions tagged [cms-block]

Denotes questions related to CMS blocks.

Filter by
Sorted by
Tagged with
33
votes
6answers
49k views

Add a static image on PHTML page and CMS Blocks : Magento2

How I can Add a static image on PHTML page and CMS Blocks into Magento2? in Magento 1.x it was possible using $this->getSkinUrl('images/xyz.jpg') I am trying following method into Magento2 In ...
16
votes
4answers
31k views

Magento 2 : Adding static blocks to specific section of pages with custom module layout xml file

In magento 1.x it is possible to add a static block using xml layout file. <reference name="root"> <block type="cms/block" name="name"> <action method="setBlockId"&...
15
votes
4answers
4k views

CMS block caching issue in EE 1.14.2

I have an issue that seems to be related to the caching of CMS static blocks. I have a cms page and within that page I am rendering a number of cms static blocks. A simplified version of the CMS ...
14
votes
3answers
42k views

Magento2 - How to show a block content on homepage

How to show a block content on homepage? After install magento2 without sample data, I chose 'Magento Luma' theme and add 'Home Page Block' block and copy the code from the sample store. but nothing ...
13
votes
3answers
10k views

How to add a CMS block programmatically in Magento 2?

I need to add a CMS block via an install/upgrade script. I've already figured out how to add "normal" CMS pages as seen in the script below. But since I can't find any way to add CMS blocks in Magento ...
8
votes
2answers
237 views

store_url does not render link correctly

I am using this link in my static CMS block <a href="{{store_url='produkte/insektenschutz/fenster/spannrahmen.html'}}"> but it renders as https://www.mysite.de/produkte/insektenschutz/fenster/ ...
7
votes
3answers
5k views

Cookie Restriction Mode Translation

With latest release, CE 1.8.1 cookie_restriction_notice_block went to before_body_end in layout (/app/design/frontend/base/default/layout/page.xml). But users don’t realize about that notice nor that ...
6
votes
6answers
36k views

Magento contact form in CMS page

I'm new in magento and I wonder how to create a form in a CMS page and receive the information by email. I did some research on the internet but I did not find explicit answers.
6
votes
1answer
8k views

Magento2 images in CMS block [duplicate]

I have an image in: /var/www/html/app/design/frontend/Alothemes/milano/web/images/natale/IMG_7300.JPG How can I refer to this image in CMS block? I know I should use: <img src="{{media url="..."}...
6
votes
1answer
2k views

Magento 2: Get WYSIWYG editor's data in frontend?

I add wysiwyng editor in admin Ui form. <field name="content"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="...
6
votes
3answers
5k views

Get content of CMS block by identifier

I need to create a module which lets the backend user add tooltips to the products custom options. So I created a field which the user fills with the unique identifier of a cms block which contains ...
5
votes
2answers
5k views

Get all item-Ids from a Collection

I found out how to get the first item from a collection: $pageId = Mage::getModel('cms/page')->getCollection() ->addFieldToFilter('identifier', 'your name in the pages') -&...
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>...
5
votes
1answer
3k views

Magento 1.8 static block in widget not showing?

I have created simple static block and trying to show it through widget inside Left Column but its not showing. In fact any static block is not working through widget. I have created magento theme in ...
4
votes
3answers
7k views

Magento2 - Is it possible to get base url in a static block?

I'm trying to get the base url in a static block. I've tried the following code: <a href="{{base url=""}}../business"> I knew this wasn't going to work because it needs <?php ?> around ...
4
votes
1answer
4k views

Magento 2 Load - Block (CMS Static Block in Magento 1 terms)

I am attempting to load a static block from my controller - but am having trouble locating the right syntax for doing this. What is the proper syntax to load a CMS block by identifier or block id and ...
4
votes
1answer
5k views

Magento 2 - How to add or insert PDF file in a CMS page?

Do you have an idea on how to add or insert a PDF file in a CMS page or CMS block in Magento 2? Correct me if I'm wrong for the question title for this thread.
4
votes
1answer
3k views

Magento 2: How to call CMS Block in email templates?

In Magento 1, we can call CMS Block in email templates like that: {{block type="cms/block" block_id="mail_include_header"}} I try above code for Magento 2, but it does not work. How can we call CMS ...
4
votes
2answers
789 views

Magento 2.0 Call cms page in phtml file

I have created one CMS page brand and I want to call brand CMS page in phtml file. So how can I call the CMS page? I got following code but it's not working. $cmsPage = Mage::getModel('cms/page')-&...
4
votes
1answer
979 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="...
3
votes
2answers
14k views

Magento2 contact form in CMS page

in magento 1.x for add contact form in CMS page i use next code {{block type="core/template" name="contactForm" form_action="{{store direct_url='contacts'}}/index/post" template="contacts/form.phtml"}...
3
votes
4answers
397 views

Why my homepage doesn't display a cms block content?

I have programmatically created a CMS block, which is working fine. I've added some content into it and trying to display it in my homepage. My block identifier is this_is_a_block_identifier. I'm ...
3
votes
1answer
1k views

How to edit the sorting order of New Products displayed on Magento homepage

I am showing new products on homepage with the code {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} Now the results ...
3
votes
1answer
670 views

How to call CMS Block via its identifier in Product edit / add page?

I want to call a CMS Block via its identifier in a product attribute to display CMS block on product page. Want to show different Static Block on different products So how can I achieve this via ...
3
votes
2answers
3k views

Contact form block in CMS page not working

I made custom layout page for CMS page and i want to add Contact form in that CMS page. For this i am using following code in CMS page content : {{block type=”core/template” name=”contactForm” ...
3
votes
1answer
2k views

Display Static block list in drop down in create product page

I want to display the static block list in magento admin product creation page. I referred this link http://www.milessebesta.com/web-design/magento-use-custom-product-attributes-to-add-cms-static-...
3
votes
1answer
2k views

Magento 2 how to Load custom collection data using Ajax

I want to display modal collection data using load more Ajax functionality, currently i am display load more data using jquery & CSS. Because for now i have a limited collection data but in ...
3
votes
1answer
216 views

Add current url as variable in CMS content

Is there a way to add current url in CMS content? Just like when I add the store name, something like this {{config path="general/store_information/name"}}
3
votes
1answer
1k views

Static blocks on home page CE 1.9 RWD Demo Theme

I was wondering how you would create the static blocks on the home page in the RWD Madison Island theme, the three below the sliding banner? Can they be created just using the static blocks and ...
3
votes
1answer
184 views

Magento 2.3.0 TinyMCE removes anchor tag href suffix when used with {{store url=''}}

I am trying to add category link in the CMS block. <ul class="list-unstyled"> <li><a href="{{store url=''}}test-collection.html">Test Collection</a></li> </ul> ...
3
votes
4answers
306 views

Magento 2.2.5 page and block module not displaying grid and button

I just installed Magento 2.2.5 but in admin > content > page the page grid and the button are not displaying. Even in the block the same issue happens, records grid and button is not displaying. ...
3
votes
0answers
473 views

Magneto2 remove widget via xml in custom page

In all cms pages i use widget. How can i remove widget by id on specific CMS pages? For remove block i use: <referenceBlock name="block_name" remove="true"/>
3
votes
1answer
643 views

Programmatically create static block and add it to selected store views

I need to create static blocks programmatically. How to assign a block to selected store views? I've found tutorials about creating static blocks, but they all add the block to all store views, like ...
3
votes
0answers
30 views

Custom Attribute listing

Hello I have created one custom attribute "Brand" with select box and add lots of brand for product. Now I want to display brand value with alphabets order in cms page.
2
votes
1answer
5k views

WYSIWYG / TinyMCE Editor keeps removing <a> tags in CMS blocks in Magento 2

I'm trying to add a link to each div but whenever I save the block, the <a> tags gets stripped out. Any help would be appreciated <div class="banner-pods"> <a href="http://www....
2
votes
3answers
6k views

How to check whether a block exist ( based on its type )

This really confuses me !! I came to a situation, where I need to create a new block (core/template block) programmatically, if there is CMS Block present in a page layout. In general case, according ...
2
votes
1answer
1k views

Magento 1.9 - Store Hours of Operation not available for CMS

Under Admin->System->Configuration->General, there is a field called Store Hours of Operation. Referencing to this field using {{config path="general/store_information/hours"}} in a static ...
2
votes
2answers
5k views

Calling to custom block from cms page display blank page

I've created a custom block, however when calling the block from cms page displays nothing. Even the content of cms page does not displat that is above the call to custom block Here is How i'm ...
2
votes
2answers
88 views

Get content of CMS Block in Magento 1.x

i want get content in CMS Block, i tryed this code but it not show content My code : <?php foreach ($this->getAgreements() as $_a): ?> <?php echo $_a->getContent() ?> <?...
2
votes
3answers
671 views

what is the difference between cms page link and cms static block. Catalog product link and catalog category link

I know about catalog new product list, and how to make them show on the home page using the widget. But am having a hard time understanding the difference between cms page link and cms static block. ...
2
votes
1answer
1k views

Added block to whitelist, but blocks still not showing (6788)

I also have a problem with custom blocks on my home page CMS after 6788. The CMS page uses a slider, which is on the backwards incompatible list because of the old router config. I used supee-6788-...
2
votes
3answers
676 views

How to resolve conflict when CMS page URL and controller rewrite URL are the same?

I have a page named stores and I have a following rewrite: <global> <rewrite> <designer_url> <from><![CDATA[#^/stores/#]]></from> ...
2
votes
2answers
419 views

Magento2 Multiple Blocks returns same object

{{block class="Class_path" name="xyz" template="Package_Module::file.phtml" id="6"}} {{block class="Class_path" name="xyz" template="Package_Module::file.phtml" id="7"}} {{block class="Class_path" ...
2
votes
2answers
5k views

get cms block title magento2

In my custom theme I have placed a cms block in a .phtml file like this: <div class="data item content" id="footer-impressum-tab" data-role="content"> <?php echo $block->getLayout()-&...
2
votes
2answers
429 views

Magento 2.1 :- CMS Page and Static Block

Here one issue in my magento 2.1. I create one di.xml file for my own module but i got error in cms page and static block. Check below image for cms page and static block error. CMS Page:- Static ...
2
votes
3answers
3k views

Block type not working

I cannot insert blocks in the CMS editor in the form {{block type="isfeatured/isfeatured" template="isfeatured/featureblock.phtml"}} The Magento version is 1.9.0.1 patched. The patched were applied ...
2
votes
1answer
107 views

How to find Magento Page Source Bug

I have applied a theme to my magento site. I find that when the website gets minimized to a certiain size there is a slight code bug where I see a piece of text that needs to be deleted. I need to ...
2
votes
1answer
380 views

Saving cms blocks after 2.3.1 upgrade now display the html on frontend

After the 2.3.1 upgrade, which included/enabled Page Builder, a custom section we have that loads block content and displays it now escapes the html tags so it outputs all of the html visible on the ...
2
votes
2answers
770 views

Get cms block parameter in Bock Class

How can i get this "cat" parameter from my cms page block {{block class="Magento\Framework\View\Element\Template" template="Altravista_Carousel::product/carousel.phtml" cat="3"}} in my Block Class? ...
2
votes
2answers
915 views

Is it possible to get system configuration value in Static block/ CMS page

I have eight static block list. Client want to change some part of string in these static block according the current month. I can achieve this though the code, but client have access only of backend, ...