Hot answers tagged

28 votes

Add static cms block in home page

I may be totally wrong, but you can call it like this {{block type="cms/block" block_id="home_image-center"}} in cms -> homepage-> content : in that click show/hideeditor past above code it's ...
user avatar
28 votes

layered navigation isn't populated by collection attributes -- CMS page

As explained in the comments, I don't think there is a way to do this by using the cms pages because you have no layer model associated to the new products list. You only have layer models for the ...
user avatar
  • 196k
27 votes
Accepted

CMS blocks disappeared after 1.9.2.2 update

My understanding is that CE 1.9.2.2 includes all the changes from the recent-patch SUPEE-6788, one of which was restrict the blocks that can be used in CMS blocks, pages, emails (etc...) by default. ...
user avatar
  • 1,234
26 votes
Accepted

How to add a CMS block programmatically in Magento 2?

add this to the your class: private $blockFactory; and make your constructor look like this: public function __construct( PageFactory $pageFactory, \Magento\Cms\Model\BlockFactory $...
user avatar
  • 196k
23 votes

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

As explained in Where is the code for "{{store url="example/example"}} {{store}} is one of the so-called template directives used by CMS and transactional emails It is documented as ...
user avatar
20 votes

CMS blocks disappeared after 1.9.2.2 update

I used below method: System > Permissions > Blocks Add New Block Block Name: cms/block Is Allowed : Yes This seems to have done the trick for me.
user avatar
  • 433
20 votes

Magento 2 - How to create FAQ page with accordion

It is possible. If you want to use data-mage-init Then you do it like this: <div id="element" data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": false, "...
user avatar
  • 431
18 votes
Accepted

Magento admin panel gives 404 when trying to enter cms pages

Had this exact problem.. You are getting a 404 on CMS pages because of the remains of old store views still hanging around in the database after deleting store views from magento admin, to clean up ( ...
user avatar
  • 547
16 votes
Accepted

Adding custom fields in the cms - Magento

So as mentioned the atwix blog is actually a very good on for this but I will expand on it to include the main module parts also. Create Module So firstly to create out module we will need a module ...
user avatar
15 votes
Accepted

Magento 2 : Add Hero Image Upload Field on CMS page

First you have to create your own module to override the save action and dataProvider for cms page. If you don't know how to create module Please refer this link http://inchoo.net/magento-2/how-to-...
user avatar
14 votes
Accepted

Removing Header and Footer from CMS page

when editing the cms page, there's a field called layout update. use this code in it: <reference name="root"> <remove name="header"/> <remove name="footer"/> </reference&...
user avatar
  • 807
14 votes
Accepted

Forgot username and password after installing magento cms on my local server xampp

If you are having troubles and want to reset it to a different password, just run at your sql database: SELECT * FROM admin_user; Then, find the username you want to modify in the listing provided - ...
user avatar
14 votes

How to add a CMS block programmatically in Magento 2?

You can try the following solution: Add 2 classes to the constructor: /** * @var \Magento\Cms\Model\BlockFactory */ protected $blockFactory; /** * @var \Magento\Cms\Model\BlockRepository */ ...
user avatar
  • 3,728
13 votes

Add static cms block in home page

It is a late reply, but i will share. It is true that you can do it all from admin. You can add any static block to any cms page directly from admin as a widget. Open the CMS page and then click on ...
user avatar
12 votes
Accepted

Adding content block to the Home Page, removing 'std' <div>

Let us divide your problem into 3 sections and review it. 1. You need to add a template file to your CMS Page The method you adopt here will work for sure. That is you need to add this code snippet ...
user avatar
12 votes

There was no Home CMS page configured or found

System=>Config=>General=>Web Current config scope. If this is a simple store, it's probably defined in Default Config, check other scopes to make sure it hasn't been redefined elsewhere. (...
user avatar
  • 7,573
12 votes

Magento 2 - upload SVG files

If you wan't change core files add this to di.xml of your module <type name="Magento\Cms\Model\Wysiwyg\Images\Storage"> <arguments> <argument name="extensions" xsi:type="...
user avatar
  • 329
11 votes
Accepted

Call custom template in CMS page

Let me give you an example, if you want to define a homepage for your website, all you'll have to do is create a CMS page called "home" (original right?) and add {{block type="core/template" template="...
user avatar
11 votes
Accepted

store_url does not render link correctly

Add store direct_url instead of store_url <a href="{{store direct_url='produkte/insektenschutz/fenster/spannrahmen.html'}}"> spannrahmen.html will show after this.
user avatar
  • 8,888
10 votes

Get CMS page for the correct store view

You can use below code: $identifier='foo'; $page = Mage::getModel('cms/page'); $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId()); ...
user avatar
  • 75.8k
10 votes
Accepted

Contact Form Not Working or Displaying Confirmation / Failed Message

It's happening because the action attribute of form gets set by the controller file of the module, which is not being called as you are placing it on a custom page. You'll need to add that action to ...
user avatar
  • 1,949
9 votes
Accepted

Add static cms block in home page

Right, so I (and you guys) were very close. In the current CMS page in Design > Custom design > Custom Layout Update XML field I had to put <block type="cms/block" name="home_center-image" before=...
user avatar
  • 1,283
9 votes
Accepted

How do I show sub-categories as images for a specified category?

The things I do for a bounty....This is a fully functional module that will list your subcategories in a category page or you can use it to show them in a static page or block by passing a category id ...
user avatar
  • 196k
9 votes
Accepted

How do I modify Magento rendered page before it's displayed?

If you need to change the content of a page using in observer means you need to do something with layout of the page. There are lot of events available to alter the layout of magento. To select the ...
user avatar
9 votes
Accepted

If Statements in CMS Page

There are two problems with this code There is no var keyword in the if directive The template filter cannot evaluate conditions. You should give request_quote a boolean value (or leave it empty if ...
user avatar
9 votes
Accepted

Change page title via local.xml

Unfortunately, Magento does not support page specific handles for CMS pages. You can only change title for all CMS pages via local.xml which is not what you want. I suggest you use the backend when ...
user avatar
9 votes

CMS and Block content warning Magento 2.4.2

I experienced this error too this morning and I dug a little : Magento\Cms\Model\Wysiwyg\Validator is responsible of this notification. ATM, it seems that it just shoot a message with no repercussion. ...
user avatar
  • 901
8 votes

Constructing add-to-cart url from CMS page

I would just use the {{block}} directive to call your own .phtml file. You could do something such as: {{block type="core/template" template="your_template.phtml" product="52"}} Remember, any ...
user avatar
  • 4,638
8 votes

Add static block in specific CMS page

To add static blocks through Layout Update XML in CMS Pages use something like this code <reference name="right"> <block type="cms/block" name="your.1st.block.name" before="-"> ...
user avatar
  • 3,602
8 votes

Magento 1.9.1.0 - Upload PDF File Type in Wysiwyg Editor and show PDF Icon

In order to allow to upload and link pdf file, I modified your config.xml <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Pdf_WysiwygFiles> <version&...
user avatar
  • 460

Only top scored, non community-wiki answers of a minimum length are eligible