Magento 2 Theming Changes: Jikke Broxterman
Magento 2 Theming Changes: Jikke Broxterman
Jikke Broxterman
General Changes
• app/design/frontend/vendor/mytheme
<var name="category_page_grid:type">small_image</var>
<var name="category_page_grid:width">250</var>
<var name="category_page_grid:ratio">1</var>
<var name="category_page_grid:height">250</var>
Steps to create custom theme
• Create directories for static files
• app/design/frontend/vendor/mytheme/web
app/design/frontend/vendor/mytheme/web/css
app/design/frontend/vendor/mytheme/web/fonts
app/design/frontend/vendor/mytheme/web/js
app/design/frontend/vendor/mytheme/web/images
Example of override product view
• Create module override folder
- app/design/frontend/vendor/mytheme/Magento_Catalog
• <container>
A container renders child elements during view output generation of
<container> and <block> elements.
• <action>
Example:
<action method="setText">
<argument name="text" translate="true" xsi:type="string">Text</argument>
</action>
Common Layout Instructions
• <remove>
- basically the same as 1.x
• <move>
- Sets the declared block or container element as a child of another element in
the specified order.
• <update>
- Includes a certain layout file.
• <argument>
General Overrides
• Create module override folder
- mytheme/Magento_Theme/layout/default.xml
- mytheme/Magento_Theme/layout/default_head_blocks.xml
• …..?
References
• http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/
themes/debug-theme.html
• http://inchoo.net/magento-2/frontend-theme-architecture/