Hi,
I am running Magento 2.3.5-p1, but it is not possible to add a custom layout update anymore on my CMS page. For example I would like to add a code like this:
<reference name="content">
<block type="cms/block" name="additional.info" as="additionalInfo">
<action method="setBlockId"><id>additional_info</id></action>
</block>
</reference>
Since the new Magento version, there is only a dropdown, in stead of a blank field where I can add something.
How can I use this code in the new Magento version?
Hi @alexander_jorda ,
As of the latest Magento versions, merchants can select layout updates to be applied to specific Category/Product/CMS Page pages on the frontend. These layout updates are made by creating layout XML files following specific naming conventions.
For CMS Pages:
cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml
where:
These files must be placed in the appropriate folders for layout XML files. They will be available as Custom Layout Update options for Merchants after flushing the cache.
Thanks!
-------------------------------------------------------------
Problem Solved! Click Kudos & Accept As Solution.
Thanks for your answer. Where do I need to put those new xml files? I do not have this path for example:
app/code/Vendor/Module/view/frontend/layout/catalog_product_view.xml
I found it already.
For a block you need to use:
<referenceContainer name="content.bottom"> <block class="Magento\Cms\Block\Block" name="block_identifier"> <arguments> <!-- Here is the CMS Block id --> <argument name="block_id" xsi:type="string">my_cms_block_identifier</argument> </arguments> </block> </referenceContainer>
This is what I have used now, but the sidebar block is on the bottom of the left side. How can this be displayed on the upper left side?
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="sidebar.main">
<referenceBlock name="sidebar.additional">
<block class="Magento\Cms\Block\Block" name="sidebar_customer-service">
<arguments>
<!-- Here is the CMS Block id -->
<argument name="block_id" xsi:type="string">sidebar_customer-service</argument>
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
Hi @alexander_jorda ,
Can you please replace your XML code with the below code and flush the Magento cache after the changes.
<referenceContainer name="sidebar.additional"> <block class="Magento\Cms\Block\Block" name="mycustomstaticblock"> <arguments> <argument name="block_id" xsi:type="string">static_block_id</argument> </arguments> </block> </referenceContainer>
Thanks!
-----------------------------------------
Problem Solved! Click Kudos & Accept as Solution!
This is exactly my code..
<referenceContainer name="sidebar.main">
<referenceBlock name="sidebar.additional">
<block class="Magento\Cms\Block\Block" name="sidebar_customer-service">
<arguments>
<!-- Here is the CMS Block id -->
<argument name="block_id" xsi:type="string">sidebar_customer-service</argument>
</arguments>
</block>
</referenceBlock>
</referenceContainer>
<referenceContainer name="sidebar.additional">
<block class="Magento\Cms\Block\Block" name="sidebar_customer-service">
<arguments>
<!-- Here is the CMS Block id -->
<argument name="block_id" xsi:type="string">sidebar_customer-service</argument>
</arguments>
</block>
</referenceContainer>
Hi @alexander_jorda ,
In your code, if you are using 2 tags (referenceContainer, referenceBlock)
then please try to use only one tag as I used in my code.
Please follow the below link:
Thanks!
---------------------------
Problem Solved! Click Kudos & Accept as Solution.
Hi,
I have copy/paste your code. Please see the code I am using now:
<referenceContainer name="sidebar.additional"> <block class="Magento\Cms\Block\Block" name="sidebar_customer-service"> <arguments> <!-- Here is the CMS Block id --> <argument name="block_id" xsi:type="string">sidebar_customer-service</argument> </arguments> </block> </referenceContainer>
But still the sidebar is in the left bottom.