Questions tagged [cms-block]

Denotes questions related to CMS blocks.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Call phtml using block code

login to magento admin. Open any cms page and write block code in content section. {{block class="Magento\Framework\View\Element\Template" name="test_file" template="...
  • 445
0 votes
1 answer
15 views

Magento 2: performance issue with Magento\Framework\View\TemplateEngine\Php::render

I have enabled the new relic log to check the performance of the Magento 2 website. On home page I am rendering 5 blocks with 5 template files. In new relic logs, it shows homepage takes time to ...
0 votes
1 answer
25 views

On CMS block render by identifier, it brings wrong localization

I'm trying to render a CMS Block, to pass rendered HTML to jsLayout, on updater I have two CMS blocks, with same name, but for different store fronts (based on store front, the language is different). ...
  • 1
0 votes
1 answer
235 views

Display product attributes in cms block or page builder

I need to be able to reference product attributes inside a cms block or page builder, I am not wanting to create any template files I am wanting to call it like you can call a variable. So here is one ...
  • 1
0 votes
0 answers
23 views

How can I add static block with arguments in cms page?

I would like to add that static block {{block class="MSP\ReCaptcha\Block\Frontend\ReCaptcha" name="msp-recaptcha-newsletter" template="MSP_ReCaptcha::msp_recaptcha_newsletter....
0 votes
0 answers
35 views

problem with image

Image is not displaying from cms block: while inspecting the image (%5Ccache%C) on the PHP page. media/catalog/product%5Ccache%5Cb61ea1bed30c1f9d9fe7f48eaf8288bc%5C//m/e/meal.jpg instead of (media/...
0 votes
0 answers
55 views

Magento2 Pass CMS Block data to API in Json format by extracting data from Html tags

Magento2 I have created a CMS Block with HTML data inside, with tags like Ul Li etc.. In this li tags I have added new tags like <li type="XYZ" title="ABC" />, Now I need to ...
  • 3,466
0 votes
1 answer
66 views

i want to add accordion inside the cms block, but it is not taking

i want to add accordion inside the cms block, but it is not taking this is the code i want to add <div id="accordion" data-mage-init='{ "accordion":{ "activate": 2, &...
0 votes
2 answers
489 views

Magento 2 Passing parameters to Content Blocks

I'm new to Magento I want to create a block in the admin panel (Content > Elements > Blocks) which contains HTML code, CSS style, and some dynamic parameters under its content box. Example: <...
0 votes
0 answers
23 views

How to add a row within another row?

I want to add a row within another row through admin panel blocks. I'm trying to but it doesn't work so, is it even possible ?
0 votes
0 answers
11 views

Magento widget not pulling through

I have a Magefan blog widget that is pulling through the widget code on the frontend on the dev site but it works on my local! The module is up to date on both sites but I'm not sure why it's working ...
0 votes
0 answers
277 views

How to add image with link in CMS Block using Page builder in Magento 2?

In Magento 2.4.2, I am trying to add the CMS Block with image and link Image should be based on Device - Responsive ie., for web page view one image, for mobile view different image. How to add this? ...
  • 1,094
1 vote
2 answers
281 views

magento 2 how to get cms blocks toOptionArray

<?php namespace [Vendor\Module]\Model\System\Config; use Magento\Cms\Model\ResourceModel\Block\CollectionFactory; use Magento\Framework\Data\OptionSourceInterface; class CmsBlocks implements ...
  • 45
0 votes
1 answer
219 views

Call CMS Block in Non-Checkout KO Template

I am using the WeltPixel theme and want to add add a CMS block to the ajaxlogin-popup.html file below the "Forgot Password" link. I am getting this error in console: Uncaught TypeError: ...
  • 81
0 votes
2 answers
260 views

How do you create or modify a CMS Block without Deprecated Methods?

How can I create or modify a CMS Block from a list according to that CMS Block if there is or not, in the same programming code without depracted methods? load() & save() -> is the deprecated ...
  • 2,787
0 votes
1 answer
191 views

Display a static block in Homepage listing all categories

I'd like to display a static block in my CMS Homepage which lists all 1 level categories. How should I do?
  • 115
0 votes
1 answer
59 views

Product -> Content -> Edit with Page Builder -> Apply Template -> CMS Block application problem

When inserting the previously created CMS block into product description, i can apply template in pagebuilder in Super Admin, but i cannot apply template if i am not Super Admin. Is there any way ...
0 votes
1 answer
554 views

How to display CMS static blocks based on store in Magento 2

I have created two stores english and german and created static blocks with different contents based on the store in admin.Block Id(test) for both stores are the same but both blocks assigned to ...
4 votes
1 answer
317 views

How "cms_block_store" and "cms_page_store" tables are working with Primary keys in Magento?

I have a general doubt in MySql foreign key constraints and Magento. As per MySql, a table should have only one primary key for a table and a Primary key should contain unique values. I checked in &...
0 votes
1 answer
177 views

Can't get module to show in static block

Using Magento 2 I created a cms static block that points to {{block class="Inchoo\ModalOverlay\Block\etc" template="modal_overlay.phtml"}} I followed this guide on how to create ...
  • 47
0 votes
3 answers
550 views

Header and Footer in Luma theme

I want some customization theme luma in my magento 2 website, so I need add in header for all pages banner - custom blocki created - (banner-section) below menu and in footer I need add custom block (...
  • 69
0 votes
3 answers
418 views

magento2 how to implement graphql with alpine.js get cms static block data

I have create a static block in magento2 admin panel. I like use graphql with alpine.js to get data of the static block.
  • 1
0 votes
1 answer
29 views

Other Method for call a custom customer attribute

I am doing an internship in a company, and my internship supervisor wants me to display customer data. More precisely, on the back office in the customer information there is a custom attribute that I ...
0 votes
0 answers
231 views

How to add cms static block to category description programmatically

Instead of directly add cms block to category description, how to add programmatically?
  • 105
0 votes
1 answer
100 views

How to add CMS Static block above product Description Section

I want to add cms block above description, how to do in custom theme?
  • 105
0 votes
1 answer
97 views

How to set cms block design full width?

For my design i am using cms block as my hero banner, how to set full width?
  • 105
1 vote
1 answer
156 views

M2 - Best practice for adding custom less file in Custom Theme for CMS Static Block

I just created custom theme, i have followed a number of guides to properly setting up .less files in a custom theme and nothing seems to be working. Where should i place less file for cms custom ...
  • 105
1 vote
1 answer
59 views

M2 - How to include custom theme directory less file path into my CMS block?

I have created custom theme which is inherit from blank theme, I have created more than one CMS block and include into CMS page for home page design. One of my CMS block named service banner In the ...
  • 105
0 votes
0 answers
47 views

Pull in Terms and Conditions from Static Block

On Terms and Conditions we try to pull in a static block {{block class="Magento\Cms\Block\Block" block_id="terms_and_conditions"}} {{block id='terms_and_conditions'}} Both ...
  • 14k
0 votes
3 answers
187 views

Magento 2 how to work with CMS blocks and CMS pages on repository?

I have created many blocks but as far as I know only by exporting them from database is the only way to have their code. Is there another way to have the files? because pushing and commiting .sql to ...
1 vote
0 answers
124 views

cms blocks removing content after save in magento 2?

cms block break html tags after saving data. it is removing url of image and display like this <div class="col-sm-12 col-xs-12"> <a href="#"> <img class="...
0 votes
1 answer
74 views

show all products in one page on magento 2

I want to show all products in one page from a custom cms block. This is the code I tried: {{block class="\Magento\Catalog\Block\Product\ListProduct" template="Magento_Catalog::list....
  • 455
0 votes
1 answer
166 views

Display CMS Static Block At Shipping Step Outside Order Summary

I want to display a cms-static block outside summary at shipping & payment step in side bar please check below attachment of output Shipping Step Payment Page Find checkout_index_index.xml code ...
1 vote
0 answers
90 views

Show wishlist counter on header when it doesnt have items

I need to display cart and wishlist counters on my own header block. For the first one i've just modified the CSS to display block. But I can't find how the wish list counter works, so it will show 0 ...
1 vote
1 answer
140 views

Magento 2 - WYSIWYG uploaded images resized to 500px wide. How can I prevent this?

When uploading large images to be used within a block or page, Magento 2 resizes them to 500px width. I don't want that instead I want them left at their original size. I have no extensions installed ...
1 vote
0 answers
148 views

Cannot insert widgets in CMS page or static block, somebody know what could be wrong?

using Magento version 2.3.5-p1. Have the follwing problem and do not know why this is not working anymore. Editing a block, disable editor and clicking on "insert widget" I get a 404 page ...
0 votes
2 answers
96 views

How to add Slick Slider

I want to add slick slider on my home page in magento using static block and phtml with rotating images. if anyone have idea about that then please answer my question as soon as possible. Thank you ...
  • 507
0 votes
1 answer
89 views

Override xml files

Is it possible to override etc/import/block.xml with child theme ? I have modified block.xml itself and works fine for now but if I update 3rd party extension my modifications will be lost . I am ...
2 votes
1 answer
2k views

Magento 2.3.5 - Inline Translate within a CMS Block

I'm running a multi website and store setup. I'm trying to use inline translation within a CMS block so I don't have to create multiple blocks for different stores. For example I'm using this within ...
0 votes
1 answer
109 views

Magento 2.3.4 - Call phtml file within CMS block

I'm trying to call the following phtml file into a CMS block. Phtml file location app/design/frontend/{Package}/{theme}/Magento_Newsletter/templates/subscribe_footer.phtml I tried using {{block ...
0 votes
0 answers
83 views

Magento 1.9.4.0 CMS Block Widget Issue

I'm trying to add widget to cms block or page but when i add it only display short code on page and not render, i tried different magento default widgets results is same also tried using code on ...
0 votes
1 answer
1k views

How to update existing CMS block content using data patches?

I have updated content for the existing cms page by using data patches in Magento 2.3.3, but the same approach not working for CMS block. <?php namespace Test\CmsExport\Setup\Patch\Data; use ...
2 votes
2 answers
2k views

Magento 2 graphql get the cms block based on store

I am trying to get the cms block based on store, but it is alway returning the default store block content. The query I used : { cmsBlocks(identifiers: "login-data") { items { identifier ...
0 votes
2 answers
65 views

Show parent categories on a page

I am a beginner in Magento. This may be a simple question. I have a header menu 'shop'. This link should redirect to a page that shows all parent categories. How can I do this? any help is really ...
0 votes
1 answer
51 views

magento 2.2.3 how to add a new cms block or new phtml to product page

I want to add a new cms block or PHTML to the product page. I have the following files composer.json, etc/module.xml, and registration.php I have view/frontend/layout/catalog_product_view.xml &...
1 vote
2 answers
2k views

How to make the Video Autoplay in cms block? Magento 2.2

In Cms Block, I'm trying to add an embed Youtube video that would autoplay upon the page is loaded. However, the part that defines autoplay "?autoplay=1&loop=999999999999&playlist=_bkTXNozzzQ" ...
1 vote
2 answers
532 views

Adding a block inside a block already in a container

I have a third-party module and I'm trying to inject a block of my own (a CMS block) between two of their blocks. I'm doing something wrong because I can get my block to appear at the very end or the ...
  • 679
1 vote
1 answer
89 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 ...
  • 671
1 vote
0 answers
92 views

Magento 2 How to create Hero image module to CMS page [duplicate]

I have created the hero image module for the CMS page. But the image is not uploaded and there is issue to save the image too. Is there any solution for that? please suggest.
0 votes
1 answer
1k 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 ...

1
2 3 4 5 6