Questions tagged [static-block]

CMS static blocks are a Magento utility that allow a site builder to make certain elements of a page editable. Elements that have been created as a static block can me modified by a site administrator through the Magento admin panel.

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

Magento 2 add CMS block under discount code section on the checkout page

I want to add third party JS code and HTML on the checkout page under discount code section. To add it under discount code first in Checkout_index_index.xml file I have added following code. <?...
2
votes
2answers
46 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() ?> <?...
0
votes
0answers
31 views

Magento2.3.1 static blocks having extra divs

While I'm saving the static block extra div's are adding to static block. How avoid the div's in magento 2.3.1. <div data-content-type="row" data-appearance="contained" data-element="main"><...
0
votes
2answers
50 views

Magento 2 How to update block programmatically?

How can i update block content programmatically?
0
votes
2answers
44 views

Add arguments in CMS Block

The project is using the Bluefoot plugin to add the block in cms_index_home. I created a static block in Magento Admin with the follow content: {{block class="ProductsRegulars\Block\Recommendation\...
0
votes
1answer
58 views

add style on static block

I have HTML code for slideshows and [CSS and javascript] but on the static block in magneto 2.3 I can not add a link to CSS and javascript Example . before save <script src = "http://localhost:...
4
votes
2answers
41 views

How to create a custom form?

I am trying to create a create a page in block but I'm trying to add a custom contact form. I can view it in frontend but it wouldn't work its not doing anything when I click submit. is there anyone ...
3
votes
0answers
23 views

insert different block in the middle of block content

I have a phtml for a block like this : app/code/Vendor/Modul/view/frontend/templates/main.phtml <div class="business-container"> <nav class="mini-head"> </nav> <div class="...
0
votes
1answer
28 views

Add css to a block Magento 1

In Magento 2, there is a box to place custom CSS to any block. However, I don't see that as an option in Magento 1 How do I add custom CSS to a block in Magento 1? Edit for possible dupe: I want ...
2
votes
2answers
31 views

Magento 2: How to add a div in below navigation?

I am trying to get a div displayed directly below the navigation on a theme which extends Luma I have added the following into my Magento_Theme/layout/default.xml but cannot see any results. The ...
0
votes
1answer
23 views

Add content of static block as new tab to product detail page

I created 3 static blocks with just a random headline for now, where I want to add html content later. the ids of the blocks are: warranty instructions certificates I then created 3 .phtml files ...
0
votes
0answers
23 views

Upload image from cms static block magento 1.9

When i save block after update or create new static block with insert image then no image add and it redirect to back page (static block page).
0
votes
1answer
42 views

Magento 1 : Unable to save the Static blocks on edit existing blocks

I have 1.9.0.3 Magento website, everything was fine, website wasnt edited in a year and when I tried to edit some existing static block and save or save and continue editing I am returned in CMS/...
2
votes
2answers
49 views

Get static block content by identifier in helper class?

I am trying to get the content of a static block in a helper class. So far I had no luck. So, how can I get the content of a static block by block identifier in a helper class? I tried: $...
2
votes
2answers
106 views

Static Block stylesheet is not applied in PWA

I have created one CMS block in my admin panel and want to display it on my PWA homepage. I have added below code in my RootComponents/CMS/CMS.js file. import React, { Component } from 'react'; ...
0
votes
0answers
17 views

How to update multilingual static blocks content programmatically in Magento 1

I've created 2 static blocks for 2 different languages. Both of them have the same identifier: identifier: privacy-policy (name: Privacy Policy EN) identifier: privacy-policy (name: Privacy Policy DE)...
0
votes
2answers
323 views

Magento2: WYSIWYG / TinyMCE Editor every time removing <a> tags in CMS blocks

I am adding HTML in CMS block editor but it keeps removing <a> tags from Html. Does anyone have a solution for this? Thanks
1
vote
0answers
19 views

Edit dropdown attribute of Sub category

I am trying to fill-in the information of a product category in Magento v.1.9.4.1, however, I am unable to locate or figure out how to add an additional option under this "Dropdown" menu I was able ...
0
votes
1answer
39 views

Magento 2 : How to get static block as html content on frontpage?

As we know that we're able to render html content up in front as using below code echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('identifier')->toHtml(); ...
0
votes
1answer
23 views

Adding a static block messing up footer?

I am trying to edit the category page on my Magento 2.3 site. I use the pearl theme. I took out all the default text and pictures and called a static block. The static block looks how I want, which is ...
3
votes
3answers
266 views

Magento 2: Static block image upload not working

I am using Magento 2.3 I am unable to upload image static block. It will show insert file instead of image. I don't know what is the problem here
0
votes
1answer
49 views

How to add static block in invoice PDF?

I am using Magento 1.9.3 I want to add a static block in invoice pdf. Can I load any static block? If it is possible then how I can do this?
0
votes
0answers
91 views

Magento 2 : How to get data from cms block into a js file

I have created a cms block in backend with the id wsmaterial. I have a modal that is created in a JavaScript file and the content for the modal should be the html from the cms block. Right now, it ...
4
votes
1answer
126 views

Create Block Hide/Show Editor removes empty span

I created a new block in Magento 2.3 and want to use <span> to place some icons in front of a text. I clicked on Hide/Show editor and pasted my code <div class="item"><span class="top-...
1
vote
0answers
43 views

How to make checkout a static block / have identifier like static blocks or pages?

Can I make magento checkout to have an identifier/ID like static blocks and pages? What's the best practice or solution to do this? I'm currently calling out magento pages / static blocks through ...
1
vote
0answers
75 views

Magento 1.9 Warning: require_once and Fatal error: require_once

Anyone, can you help me how to solve this? Warning: require_once(/srv/app/Mage.php): failed to open stream: No such file or directory in /srv/public_html/abstract.php on line 85 Fatal error:...
6
votes
2answers
218 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/ ...
1
vote
1answer
30 views

Magento2 can't call custom phtml fail in CMS Static Block

I have tried many ways to call the custom phtml file in Static Block but none of them seems to work. My file is located - app/design/frontend/Magento/MyTheme/Magento_Theme/extra/test_view.phtml How ...
0
votes
1answer
33 views

Links in static block don't show or work

In my category I call a static block to left sidebar from category custom update XML <reference name="left"> <block type="cms/block" name="kat_maerke" before="-"><action method=...
0
votes
0answers
20 views

Is it a simple way to set conditions for widget of type CMS static block?

I want a CMS static block to appear in some product pages, but not all. The condition would be "brand is xxx", but unlike other widget types there is no condition option on Widget Settings. Is there ...
0
votes
2answers
637 views

Magento 2.3.0 - Add custom block after product description tabs

I've created a CMS block called km_product_page_short_description I want to call this CMS block in a custom block below the product description tabs (where the blue line is) as shown in the ...
1
vote
1answer
73 views

How to get current page url in static blocks

I want to get my current page URL in one of my static blocks How do I get that?
2
votes
2answers
62 views

I cannot change from Products only to Static block and products in Display Settings of an existing category

Working with Magento ver. 2.2.2 I wish to change the design of category pages. Now certain categories are displaying only products, But I want to display a static block and products. I create the ...
0
votes
2answers
35 views

How to call static block by xml to phtml without refrence

I want to call a static navigation block in topmenu.phtml I defined that in default.xml <block class="Magento\Cms\Block\Block" name="top_links"> <arguments> &...
0
votes
1answer
251 views

Passing variables to static block in magento2

I have used below code in magento1 to load the static block with custom variables. Here is the code of my m1 Block file. { $customer = Mage::getSingleton('customer/session')->getCustomer(); ...
2
votes
0answers
71 views

How to get website/store id in the cms blocks/pages Magento2

I'm checking this for long time but couldn't get this.I would like to display the website id through the magento cms block/pages.Without calling it from phtml's. Thanks in Advance.
0
votes
1answer
18 views

Am I hurting performance or using bad practice by including css within my static block?

When I create a new section for my home page or a block for a category header is it bad practice to include css within that block? My thought process is that when I want to remove or change that ...
0
votes
3answers
352 views

how to call phtml file in static block?

I have created phtml file, app/design/frontend/Smartwave/porto/Magento_Contact/templates/inquiry.phtml <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license ...
2
votes
0answers
124 views

Category page, static block and layered navigation

On Magento 1.9 I have a category page with produts and static block. For static block I used a block type="catalog/product_list with a custom template. In the html template I loaded a custom ...
4
votes
1answer
144 views

A-Z Category Listing Magento 2 Static Block

I am attempting to create a A-Z category listing within a static block, something like the attached image. The static block will be on the parent category, and the listing will show the parent ...
1
vote
1answer
240 views

Magento 2 : Pass URL from Static block to PHTML

In my static block, Following is code {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/homepage-blocks.phtml" title="Scoring &amp;...
2
votes
1answer
164 views

Magento 2.2.5: Blocks added to footer display in wrong order

I've been working on a magento theme, which inherits from Magento/blank, found at http://murkyapparel.com. As you can see, the footer looks a bit of a mess. I might make some changes, so here is a ...
1
vote
1answer
114 views

Cannot create static Cms block from backend

Whenever I try to create a new static block from the backend, I always get the notice "Could not save block, sorry something went wrong". Checking logs I found this exception of the violation of ...
2
votes
2answers
591 views

Magento 2 decode widget code in category description

I have added widget(call static block) in category description http://prntscr.com/ko816y.But it is not call widget in front just showing output as it look in admin WYSIWYG editor. So,I want to convert ...
0
votes
1answer
94 views

How to find html/script file on server or magento admin

I have a magento 1.9 e-com site - furnituretrader.com.au - and I want to change the url link to a section at the bottom, however I can't locate the html section on the admin panel or the file server - ...
0
votes
0answers
28 views

Previous customers name showing in cached static block

I wanted to build a static block in Magento where when a customer logs in they see there name with a welcome message (dependant on name length), however it appears on implementation that the previous ...
0
votes
2answers
169 views

How can i add static block in magento on category page?

I want to add a static block on my website Category page. This is the link of that page. https://flowerportal.in/online-flower-delivery/all-cities/bangalore I have just created some banners for ...
5
votes
2answers
407 views

What am I doing wrong with this nested block

I am using magento 1.9 and want to insert cookie restriction notice block on my page then try to render it in my homepage.phtml but got nothing and this static block(cookie restriction notice ...
0
votes
2answers
548 views

Magento 2 Load Static Block In Controller

I tried the following solution:- Magento 2 Load - Block (CMS Static Block in Magento 1 terms) But getting some issue, you can visit here to see:- http://nimb.ws/oURqfV Here is my controller ...
1
vote
2answers
1k views

Injecting Variables into a Magento 2 CMS static block

Magento 1 Way :- https://inchoo.net/magento/injecting-variables-into-a-magento-cms-static-block/ I need the same in Magento 2, how can I achieve? it's urgent. Here is my afford:- <?php ...