How we can add container for inner page template not in home page in magento 2.2.6?
you can add / update your main.content container in default.xml file with code below, it will add two divs container-inner-a and container-inner-b after main container.:
<referenceContainer name="main.content"> <container name="container-inner-a" htmlTag="div" htmlClass="container"> <container name="container-inner-b" htmlTag="div" htmlClass="row"> <container htmlTag="div" htmlClass="row" name="div-content-row"> <container name="columns" /> </container> </container> </container> </referenceContainer>
This is how you need to update you layout file and change div names / numbers as required.
NOTE : this will add additional div on all page / layout. For home page you can get that page css class and change its width accordingly.
To write custom HTML into your magento CMS-Pages Just do follow the below given steps.
- Just go to
Admin(Back-end) > CONTENT > Elements > Pages.
- Click on add new page or if you want to edit already existing page click on select > Edit (Please refer this image).
- In that page go to
Content > Click on Show / Hide Editorto get the HTML editor section instead of the way wysiwyg editor (Please refer this image).
- Now you can write your HTML code here into this section (Please refer this image)
- To write
cssfor this page you can write
cssinto your default
- Do click on save button after making your changes there in the back-end & check the front-end for the changes done. If not getting the changes you made there on the front-end, then flush your cache.
For that you can do it from your back-end & also by executing the command from your terminal just run the below command from your terminal.
php bin/magento cache:flush