Changes Overview of View Layer in Magento 2



Similar documents
INTRO TO THEMING IN MAGENTO

Copyright 2011 Magento, Inc.

Mastering Magento Theme Design

Top Navigation menu - Tabs. User Guide 1. &

HOW TO CREATE THEME IN MAGENTO 2

Magento Extension Developer s Guide

MAGENTO TRAINING PROGRAM

Paul Boisvert. Director Product Management, Magento

Magento 1.4 Themes Design

Testking.M Q

Hitachi PaybyFinance Magento Plugin

Learning Magento Theme Development

ultimo theme Update Guide Copyright Infortis All rights reserved

CheckItOut Developer Manual

ultimo theme Update Guide Copyright Infortis All rights reserved

Magento 1.3: PHP Developer's Guide

LP Express Installation and User Manual

ProxiBlue Gift Promotions

Shop by Manufacturer Custom Module for Magento

FORTIS. User Guide. Fully responsive flexible Magento theme by Infortis. Copyright Infortis. All rights reserved

Kentico CMS 5 Developer Training Syllabus

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

Shipbeat Magento Module. Installation and user guide

CMS Training Manual. A brief overview of your website s content management system (CMS) with screenshots. CMS Manual

Table of Contents. Magento Certified Developer Exam Study Guide

How To Create A Simple Module in Magento 2.0. A publication of

Ad Hoc Reporting. Usage and Customization

EXAM - M Magento Front End Developer. Buy Full Product.

X-POS GUIDE. v3.4 INSTALLATION SmartOSC and X-POS

Hail or Fail: The Right Way. to Override Core. Mark Shust ecommerce Developer Metrics Marketing

CARSTORE RESPONSIVE MAGENTO THEME

DEMO ONLY VERSION. Easy CramBible Lab M Magento Front End Developer Certification Exam. ** Single-user License **

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

SEO Toolkit Magento Extension User Guide Official extension page: SEO Toolkit

Drupal and ArcGIS Yes, it can be done. Frank McLean Developer

User Guide. Chapter 1. SitePublish: Content Management System

MAGENTO THEME SHOE STORE

SFC Featured Categories, Magento Extension Documentation

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

PaybyFinance Magento Plugin

PORTAL ADMINISTRATION

J2T Points & Rewards Magento Extension

Official Amazon Checkout Extension for Magento Commerce. Documentation

Shop Manager Manual ConfigBox 3.0 for Magento

SAHARA FASHION15 RESPONSIVE MAGENTO THEME

SAHARA DIGITAL8 RESPONSIVE MAGENTO THEME

CMS and e-commerce Solutions. version 1.0. Please, visit us at: or contact directly by

install the extension:

Themes and Templates Manual FOR ADVANCED USERS

Copyright 2013 X.commerce, Inc. All rights reserved

Magento Quotation Module User and Installer Documentation Version 2.2

Jim2 ebusiness Framework Installation Notes

USING MAGENTO TRANSLATION TOOLS

skype ID: store.belvg US phone number:

Fortis Theme. User Guide. v Magento theme by Infortis. Copyright 2012 Infortis

Iceberg Commerce Video Gallery Extension 2.0 For Magento Version 1.3, 1.4, 1.5, 1,6

Content Management Implementation Guide 5.3 SP1

Magento 1.3 Theme Design

ULTIMATE LOYALTY MODULE

Magento PHP Developer's Guide. Magento PHP Developer's Guide. Second Edition. Allan MacGregor. Second Edition

skype ID: store.belvg US phone number:

Bazaarvoice for Magento Extension Implementation Guide v6.3.4

GPMD CheckoutSuite for Magento Documentation

This guide provides additional information about topics covered in the webinar

Version USER GUIDE

Module Customer Ratings and Reviews Pro + Google Rich Snippets Module

Magic Liquidizer Documentation

Sitecore Dashboard User Guide

FUNCTIONAL OVERVIEW VERSION: 1.0

Joomla! Actions Suite

Installation, Configuration, and Usage

Managing Third Party Databases and Building Your Data Warehouse

ultimo theme Update Guide Copyright Infortis All rights reserved

DEVELOPMENT OF AN ANALYSIS AND REPORTING TOOL FOR ORACLE FORMS SOURCE CODES

Joomla! template Blendvision v 1.0 Customization Manual

ADMINISTRATOR GUIDE VERSION

Joostrap RWD Bootstrap Template

SharePoint 2010 Interview Questions-Architect

Using jquery and CSS to Gain Easy Wins in CiviCRM

Magento PHP Developer's Guide

Zapper for ecommerce. Magento Plugin Version Checkout

Magento Theme EM0006 for Computer store

MOC 20488B: Developing Microsoft SharePoint Server 2013 Core Solutions

Bitrix Site Manager 4.0. The Guide to Managing User Group Permissions

CMS and e-commerce Solutions

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP Edge Gateway for Layered Security and Acceleration Services

Managing your Joomla! 3 Content Management System (CMS) Website Websites For Small Business

Magento User Guide. The Magento User Guide is here to help you through the process of setting up your store. The User Guide begins with an

Advanced Slider Documentation

Aspect WordPress Theme

Creating a Restaurant Website

Welcome to the Magento User's Guide Last modified by diglin on Fri, February 27, :09 Source Old Revisions. Chapter 1: Introducing Magento

Transcription:

Magento Developers Paradise March 20 th, 2013 Changes Overview of View Layer in Magento 2 Anton Makarenko Sr. Software Engineer, Magento 2

Contents 1. Problem definition for Magento 2 view layer 2. File system changes: modules, themes 3. Logical changes: theme and view configuration 4. Logical changes: blocks and containers 5. Plans for further evolution

Goals for developer and user 1. PROBLEM DEFINITION FOR MAGENTO 2 VIEW LAYER

Goals: Developer Experience Freedom in creating and structuring themes Flexibility in implementing layout, more granularity Less incentive to duplicate code

True Modularity Requirements All module files must be in one directory (of the module) A module must guarantee its operability, rather than depend on a theme Dependency on a module must be clearly visible

Goals: User Experience Simpler configuration of design in admin Less concepts to learn (fallback, skin ) Failsafe mechanisms for layout updates entered by the user Visual design editor as a standard feature (comes from Magento Go)

Improvements in modules and themes 2. FILE SYSTEM CHANGES

Directories Restructuring Magento 1 / /app/design/... /errors /js /media /skin -- index.php Magento 2 / /app/design/... /pub /errors /lib /media /static -- index.php -- index.php

View Files in Modules /app/code/mage/catalog/view /adminhtml/... /frontend /category/... /product -- price.phtml -- view.phtml -- layout.xml -- widgets.css

Templates and Layouts Relocation /app/design/frontend/base/default /layout/catalog.xml /template/catalog/product/view.phtml /app/code/mage/catalog/view /frontend /product/view.phtml -- layout.xml

Static Files Relocation /skin/frontend/base/default /js/opcheckout.js /app/code/mage/checkout/view /frontend /js/opcheckout.js

Theme File Structure / /Mage_Catalog /images/slider_btn_zoom_in.gif /product/view.phtml /Mage_Page/... -- theme.xml -- view.xml

Fallback Scheme: Templates and Layouts /app/design/<area>/<current_theme> /Mage_Catalog/product/view.phtml /app/design/<area>/<parent_theme> /Mage_Catalog/product/view.phtml /app/code/mage/catalog/view /<area>/product/view.phtml

Fallback Scheme: Static Content app/design/<area>/<theme>/mage_page/locale/de_de/logo.gif app/design/<area>/<theme>/mage_page/logo.gif app/design/<area>/<parent>/mage_page/locale/de_de/logo.gif app/design/<area>/<parent>/mage_page/logo.gif app/code/mage/page/view/<area>/locale/de_de/logo.gif app/code/mage/page/view/<area>/logo.gif pub/lib/logo.gif

How Static Content Gets Into a Public Directory Developer mode: execute fallback every time and copy to pub/static/ Default mode: execute fallback and copy to pub/static/ only first time Production mode: build a fully qualified path without checking anything

3. LOGICAL CHANGES: THEME AND VIEW CONFIGURATION

Themes that Make More Sense Magento 1 Skins: base: default default: blank, blue, default, french, german, iphone, blue enterprise: default, iphone pro: default Themes: base/default default: blank, default, iphone, modern Magento 2 Themes: blank demo demo blue iphone modern fixed design fluid design

Theme Management System All themes are registered in DB Virtual themes: Are created by the user, they don t exist out of the box Have user-uploaded assets: CSS and JavaScript The user assets do not participate in theme inheritance

theme.xml A user-friendly theme name Version Parent theme Preview images, etc

view.xml view.xml in modules and themes: <module>/etc/view.xml <theme>/view.xml Declares variables, available in blocks/templates First, the view.xml of all modules are merged; then, view.xml of current theme is added

4. LOGICAL CHANGES: BLOCKS AND CONTAINERS

Layout Improvement Goals Increase flexibility to fit needs of visual design editor display and manipulate elements on a page in WYSIWYG-style Allow more granular layouts without necessity of instantiating more objects in process of layout generation

Illustration: Block Instances

Illustration: Child Block <div class="account-login"> <div class="page-title"> <h1><?php echo $this-> ('Login or Create an Account')?></h1> </div> <?php echo $this->getchildhtml('form.login.extra')?>

Containers <container name="cms.wrapper" label="cms Content Wrapper" htmltag="div" htmlclass="std"> <block type="mage_cms_block_page" name="cms_page"/> <container name="..." label="..."/> </container>

What Becomes Possible with Containers and Blocks Hierarchical structure (skeleton) of entire page can be implemented using containers Behavior of container is predictable, which allows moving elements between containers Container can be broken down into pieces by the user, not only developer Block obtains new meaning of an indivisible unit of page. It can be broken down only by the developer

Containers in VDE

Moving Elements <move element="name.in.layout" destination="new.parent.name" as="new_alias" after="name.of.element.after" before="name.of.element.before"/>

Page Types <cms_page_view type="page" parent="default" translate="label"> <label>cms Pages (All)</label> Some of layout handles are formalized as page types List of page types is used in widgets and visual design editor

5. FURTHER PLANS FOR MAGENTO 2 VIEW LAYER

Formalized Layout XML-schema for layout files No code execution from layout Refined definition of page types and their algorithm Definition of layouts (1-, 2-, 3-column, etc) as set of containers, rather than templates

Further Evolution of Containers Ability for developer to provide limitations for container: Lock manipulation with child elements Lock parent (important for form elements) Additional container attributes for visual editing features

Refactoring of Blocks Ability to reuse an instance of block for multiple structural elements ( flyweight pattern) Considering approach of view models (aka data sources ) Different types of templates (alternatives to PHTML)

Further Improvements of Themes Optimization to reduce code duplication Removal of Magento branding from themes intended for extending Extended metadata in themes (theme.xml)

Summary Modular and more logical file structure Simpler and more flexible themes Better granularity in layout Visual design editor as a core feature

Thank you anton@magento.com http://github.com/magento/magento2 http://wiki.magento.com/display/mage2doc/