2

I have created widget that i want to show on sidebar of about us and our company page, but in widget layout update>> specified pages section i can not find any option to see any option of My Cms About us and CMS Company page ,

Is there any fix to it

asked Sep 25, 2018 at 20:58

1 Answer 1

3

It's definitely a bug or i would say more likely an overlook from magento 2 team. Magento 2.2.5 When you create the cms page you would expect the page types will get updated automatically but they are not.

I have't inspected this in depth however one static way to go around this is to create in a custom module etc/frontend/page_types.xml and add your page layout like this

<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd">
<type id="cms_page_view_id_about-us" label="CMS Pages (About us)"/>

Id is your handle of the page. You can get all handles by enabling developer tools in admin or in /Applications/MAMP/htdocs/appliance.loc/vendor/magento/framework/View/Model/Layout/Merge.php in addHandle method add in foreach echo $name and in else statement add echo $handleName.

When i catch time ill investigate how to make this dynamically but from what I have seen their code is not dynamic either for now.

I can understand from one side why it has been done like this to use page layouts but the issue is page layouts also do not work and is a confirmed bug https://github.com/magento/magento2/issues/9537

answered Oct 2, 2018 at 11:16
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.