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
3
votes
0answers
94 views

Magento 2.3.4 Page builder html wrapper

I have upgraded from Magento EE 2.2.10 to 2.3.4, I had some content blocks with custom html used for navigation links on various pages that were just tags. After upgrading If I try to edit a content ...
1
vote
4answers
109 views

Magento2: Pagination on listing page using static block

I have added a static block in the category Static block content: Category : It shows all the products on a page. toolbar not showing: How can I add the toolbar:
0
votes
1answer
16 views

Load Magento 2 static Block content in external website php file

I have a requirement like below. There is a website which is running in production mode in one server. That has some static blocks. A block is created with some content(Ex:Block_Id: sample_block). ...
0
votes
0answers
23 views

magento1.9 Static Block not updating / saving

i have change php version 5.6 to 7.1 after static block not saving SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (...
1
vote
1answer
41 views

Set different static cms block to each different product

I have a created different CMS static blocks. I need to call the respective static block for each product. I thought of getting the URL key and then assign it to the respective Products. How could I ...
1
vote
0answers
14 views

Hide Static Block from Category View on Layer Nav Click

When I setup a category page I can set it to display products, a static block or both. I would like to display a static block but when any option in the layered nav is clicked, I would like to hide ...
0
votes
1answer
109 views

Magento 2.3: Using HTML in a Static Block

Can I use HTML content in a Static Box? If so, please provide the code that I can use in the Block Content to identify the code as HTML. I am trying to use a Widget to insert HTML content into the ...
0
votes
1answer
21 views

Using a Page vs. a Static Block

I'm trying to get a very basic understanding of when I should use a Page vs. Static Block to create content for the site. Can someone provide examples of where they might be used? Or scenarios where ...
0
votes
1answer
42 views

Magento 2 : disable cache for static block

In Magento, I can disable cache for static block by add cache_lifetime="null". {{block type="core/template" cache_lifetime="null" title="BEST SELER!!!" sku="ASS030530010" template="catalog/product/...
0
votes
2answers
80 views

Create/Update static block programmatically in magento2

I am trying to create/update static block programmatically with recurringData.php from setup script. use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\...
0
votes
2answers
34 views

Magento 2 - find out if text is from static block

I try to replace the footer with my own, but I have no clue how. I activated template hints, but it does not show any hint if this is a static block. How can I modify this ?
0
votes
2answers
91 views

Magento 2.3 static Block to replace subcategories in navigation

I am attempting to add a block in place of the subcategory in the main navigation or site navigation. I don't want to use a bloated extension, just minimal code. I am using a blank custom theme I made....
0
votes
1answer
17 views

How to call static block into plugin Processor php file in magento2

How to call the static block into magento2 plugin processor php file. thanks
1
vote
1answer
82 views

Magento2 : How to add social link in static block in PWA

I have created one Static block with added below content in and I need to add social links in PWA. <a class="footer-facebook" href="https://www.facebook.com/" target="_blank" rel="noopener">...
0
votes
0answers
46 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
92 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
135 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
220 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
190 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
45 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
75 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
49 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
25 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
54 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
85 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
177 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
198 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
18 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)...
1
vote
2answers
956 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
20 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
169 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
25 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
362 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
94 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
145 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
342 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
46 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
99 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:...
8
votes
2answers
244 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
39 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
43 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
2answers
1k 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
88 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
105 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
41 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
431 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
95 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 ...

1 2 3 4 5 9