1

I want to create page or block with sidebar. if I click customer service then I want to see customer service info etc.

enter image description here

2nd Image : enter image description here

3rd Image: enter image description here

  • you can create a cms page and set its layout to 2 Columns left – Naveed Asim Oct 16 '18 at 16:34
  • I did, but I want to display all brands, customer service and sizing charts on left side. – kiran Oct 16 '18 at 16:51
0

in order to have custom layout you need to follow below steps :

Step 1 : Create layouts.xml file in Magento_Theme of your theme and paste below code in this file:

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="customer_services">
        <label translate="true">Customer Service Page</label>
    </layout>
</page_layouts>

Step 2 :

create customer_services.xml file in Magento_Theme/page_layout folder of your theme and paste below content:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
    <referenceContainer name="main" htmlClass="column main col-md-10"/>
    <referenceContainer name="columns">
    <container name="col-sidebar" htmlTag="div" htmlClass="col-md-2" before="main">
        <block class="Magento\Cms\Block\Block" name="customer.serices.menu" before="-">
            <arguments>
                <argument name="block_id" xsi:type="string">customer-serices-menu</argument>
            </arguments>
        </block>
        <block class="Magento\Cms\Block\Block" name="customer.serices.block2" after="customer.serices.menu">
            <arguments>
                <argument name="block_id" xsi:type="string">customer-serices-block2</argument>
            </arguments>
        </block>
    </container>
    </referenceContainer>
</layout>

Step 3 :

in admin Create CMS static Blocks customer-serices-menu and customer-serices-block2 and add content what you want to show on left sidebar ( you can add as many blocks as many you want just add block code with id in layout file ).

Step 4 :

Now finally create a cms page for customer services and assign Customer Service Page layout to that page and it will show content with left side bar.

  • Hi! Thank you for the response, I tried this code but i want if i click Customer service then I can see Customer service info or sizing charts have different info. – kiran Oct 16 '18 at 19:15
  • you can add that info in cms block how to manage it. – Naveed Asim Oct 17 '18 at 4:29
  • Can you explain me please in detail? – kiran Oct 17 '18 at 13:39
  • could you update your question with design layout you want to implement. as per your question you have to create a menu block and seprate page for each menu item. all pages should have Customer Service Page layout and you can setup content accordingly in each page. – Naveed Asim Oct 17 '18 at 15:03
  • Please check my update question. I want to display every sidebar have different info. – kiran Oct 17 '18 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.