Chủ Nhật, 26 tháng 6, 2016
Magento some carries a distinct set of superior frontend treatments in contrast to
it has the forerunners Magento 1 . A, currently most of us will ajax cart magento look beneath hood of Magento minimal payments 0 frontend engine. In addition to illustrate the particular nearly all useful pieces in details.
The big change is actually this frontend is normally currently kept up to date along with more modern engineering including HTML5, CSS3 and jQuery.
There are significant
changes/improvements to help entire layout mind games, submit design in addition to a brand new summary of Magento UI library closely based on LESS preprocessor utilizing created within compiler.
Several desired goalsfurthermore performance and scalability was going to serve
RWD out of your box. In this article I’ll aim to deal with many associated with the actual main
variances, dive into development and also demonstrate some practical articles.
Magento UI library
The very Magento UI library is often a flexible LESS-based frontend assortment designed to assist Magento topic developers. It employs a group of mixins for base features to ease frontend theme progress and customization.
Components furnished by the UI library
The main Magento UI library affords the ability to customize and recycle the following user interface elements along with properties:
actions-toolbar
breadcrumbs
links
drop-downs
forms
icons
architecture
loaders
messages
pagination
popups
ratings
sections
tabs in addition to accordions
tables
tooltips
typography
list of theme variables
These kinds of illustration shows a storefront solution page containing some of the former elements:
You can easily discover the exact Magento UI library in lib/web/css. Library source. a reduced amount of files are stored below thesource directory,affiliate extension for magento each computer file contains mixins for establishing a certain element, and in many instances often the element coincides
together with the file name:
lib/web
├── css/
│ ├── docs/ (Library documentation)
│ ├── source/
│ │ ├── lib/ (Library source files)
| | | ├── variables/ (Predefined variables for each and every mixin)
│ │ │ ├── _actions-toolbar. less
│ │ │ ├── _breadcrumbs. less
│ │ │ ├── _buttons. less
│ │ │ ├── _dropdowns. less
│ │ │ ├── _forms. less
| | | ├── _grids. less
│ │ │ ├── _icons. less
│ │ │ ├── _layout. less
│ │ │ ├── _lib. less
│ │ │ ├── _loaders. less
│ │ │ ├── _messages. less
│ │ │ ├── _navigation. less
│ │ │ ├── _pages. less
│ │ │ ├── _popups. less
│ │ │ ├── _rating. less
│ │ │ ├── _resets. less
│ │ │ ├── _responsive. less
│ │ │ ├── _sections. less
│ │ │ ├── _tables. less
│ │ │ ├── _tooltips. less
│ │ │ ├── _typography. less
│ │ │ ├── _utilities. less
│ │ │ └── _variables. less
│ │ └── _extend. much less
│ │ └── _theme. less
│ │ └── _variables. less
│ └── styles. less
├── fonts/
│ └── Blank-Theme-Icons/ (Library custom icons font)
├── images/
│ └── blank-theme-icons. png (Library icons sprite)
└── jquery/ (Library javascript files)
Predefined variables
When your theme inherits from just about any Magento out-of-the-box theme, one example is Blank, a person may simply individualize almost any ingredient of a retailer web site not having changing any CSS codes or web themes. Customization can be carried out by easily adjusting for your personal look the values of the defined variables used in the WELL-KNOWN library or parent subject mixins.
The complete list of these kind of variables and their default worth are stored inlib/web/css/source/lib/variables. That directory contains a set of computer files, corresponding to the set of USER INTERFACE library elements, and each on the files lists element-specific issues. For example , lib/web/css/source/lib/variables/_breadcrumbs. less has variables used in the breadcrumbs() mixin.
To change the normal library variables values, indicate the new values for the expected variables in the <theme_dir> /web/css/source/_theme. less file.
Please imagination, that your <theme_dir> /web/css/source/_theme. less file overrides _theme. less of the parent concept (if your theme possesses a parent). So if you want to obtain the parent theme’s shifting values additionally to your improvements, add the content of parent’s _theme. less to your document as well.
These kinds of figure
indicates this product page shown
prior on this issue, soon after a
personalized theme was applied. The actual motif tailored Blank by means of redefining aspects just.
Adjusting style and design by means of redefining things
Using mixins
You will be able to work with some sort of mixin with default factors principles, as well as one could restructure these individualsany time calling a mixin
. The following paragraphs describe the very both ways to call a new mixin.
To use a mixin along with default values, call the main mixin without specifying any sort of parameters. For example:
. breadcrumbs
.breadcrumbs();
To help get in touch with a mixin having pedoman values
dissimilar to default, set these beliefs if calling the mixin, similar to the main adhering to case in point
:
. example-button
.button(
@_button-padding: @button-padding,
@_button-color: #fff,
@_button-color-hover: #ccc
);
Variables beginning utilizing @_ are private mixin parameters made use of basically in this mixin. Aspects getting into with @(without the actual underscore) are global, and so are shown in lib/web/css/source/lib/variables/.
UI collection documentation
You will look for thorough learn about the Magento UI library insidecertification provided together with the
computer:
lib/web/css/docs/source/README. md: describes the particular Magento UI library design, naming conventions, and style style.
lib/web/css/docs: contains a range of. html files with complete information about the library mixins. Each one file is named after the mixin it describes, and contains comprehensive mixin description and direction-finding controls to access documentation meant for other mixins. The certification is available in a convenient PHP view in the following position in your Magento installation: pub/static/frontend/Magento/blank/en_US/css/docs/index. html
In continuation with the article, I would like to describe the new theme structure of your Magento 2 platform.
Magento 2 theme structure
Magento 2 theme structure features undergone significant changes:
Magento 2 theme structure
An entire theme is now organized somewhat to “app/design”. The “skin” folder no longer exists. Also, there is also a new approach for web template modules customization: now in the binder with the theme, each element unit will have its own _ catalog with its representation, it will probably contain templates, JS plus CSS/LESS. It is very user-friendly and even pragmatic approach. We got an easy structure, where everything is definitely sorted in very practical way.
i18n
This document contains the. csv translation documents.
theme. xml
It is familiar with initialize the theme. The particular theme name, theme type, theme parent template, style preview image should be characterized there. By the way, now Magento 2 supports multiple design inheritance.
1
2
three or more
4
5
6
6
8
<theme xmlns: xsi="http: // www. w3. org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation=".. /.. and.. /.. /.. /lib/internal/Magento/Framework/Config/etc/theme. xsd">
<title> Astrio </title>
<version> 1 . zero. 0. 0 </version>
<parent> Magento/blank </parent>
<media>
<preview_image> media/preview. jpg </preview_image>
</media>
</theme>
composer. json
Magento 2 themes are tidy as composer packages.
As a way to transform your own theme to a composer package, you will need to bring the composer. json setting file in the theme binder, and also need to register your personal package at https://packagist.org
Configuration updates/improvements
When it comes down to layout mau there are some really cool and useful new improvements.
Before delving into practical examples it is very important to mention that plan files are now divided into small parts. Practically explained instructions what once was a design handle now is a separate record.
Probably the intention was to shorten the maintenance.
Example 02
Magento 2 introduces the whole completely new concept for product/media impression resizing actions right from design. Layout file view. xml is responsible and it ought to be placed underapp/design/frontend/vendorName/newTheme/etc/ directory. At this point is an example of resizing product index chart images in action.
<view xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation=".. and.. /.. /.. /.. and.. /lib/internal/Magento/Framework/Config/etc/view. xsd">
<vars module="Magento_Catalog">
<var name="product_small_image_sidebar_size"> 100 </var>
<var name="product_base_image_size"> 275 </var>
<var name="product_base_image_icon_size"> twenty four </var>
<var name="product_list_image_size"> 166 </var>
<var name="product_zoom_image_size"> 370 </var>
<var name="product_image_white_borders"> 0 </var>
</vars>
</view>
While I presume that the definitive goal was to simplify actual resizing process for developers, it will fail under majority of reactive design situations. For example , most of us don’t want to serve significant images for smartphone end users on edge connection. Resizing from template files available a better way to serve available multiple sources for different micro profiles. Right now inspecting your blank theme I solely see a situation with just simply scaling images down with html.
One of the great plus much more than welcome changes is undoubtedly an introduction of a container wrapper, successor to a core/text_list engine block type which served typically the role of a structural prevent in the previous versions of the process. What is really interesting is a opportunity to pass attributes like htmlTag, htmlClass, htmlId directly from structure files.
My personal favorite is go method introduction. It’s a almost refined action methodset/unsetChild famous the process is much more intuitive. For instance , if we need to insert form block1 into destination block2 this is the way how we will succeed:
It automatically makes resource block1 a child of a place block 2 .
It’s essential to mention that Magento two offers a system validation with regard to XML files using xml schemas for individual and joined layout files.
The Magento 2 frontend system seemed to be significantly improved, now it is considerably more technologically advanced and much easier to consult with. Unfortunately, it is impossible to pay all changes and revolutions http://www.magebuzz.com/birthday-coupon.html of Magento 2 within a document. With potential articles or blog posts Magesolution will for certain do the matter
, and we'll begin considerably more depth about the very Magento 3 technological know-how universe.
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét