Chuyển đến nội dung chính

Magento2 Cheat Sheet


Magento 2 tutorial


http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/bk-frontend-dev-guide.html
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-1
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-2
http://alanstorm.com/category/magento-2/



Frontend CLI


php bin/magento setup:static-content:deploy
php bin/magento setup:static-content:deploy --theme=Vendor/mytheme
php bin/magento setup:static-content:deploy --exclude=Magento/luma,Magento/blank
php bin/magento setup:upgrade

Here are the commands to cache and reindex.


php bin/magento cache:disable
php bin/magento cache:flush
php bin/magento indexer:reindex

How can I de compile using command?


php bin/magento setup:di:compile

Turn template hints on/off


UPDATE
`core_config_data`
SET
`value` = 1
WHERE
`path` = "dev/debug/template_hints_storefront"
add js file via require.js
Create file requirejs-config.js at app/design/[vendor]/[theme]/web/ with this content
var config = {
    // When load 'requirejs' always load the following files also
    deps: [
        "js/wim" //js file yang akan di load simpan di app/design/[vendor]/[theme]/web/js
    ]
};

magento new js file example to load other js lib


define([
    'underscore',
    'jquery'
], function(){
    "use strict";
    _.each(["Hello", "World", "!!!!!!!!!!!!!!!!!!" ], console.log);

});

Grunt


grunt exec:<your_theme>
grunt less:<your_theme>
grunt watch

Less breakpoint variable




@screen__xxs: 320px;

@screen__xs: 480px;

@screen__s: 640px;

@screen__m: 768px;

@screen__l: 1024px;

@screen__xl: 1440px;

Nhận xét

Bài đăng phổ biến từ blog này

Google Chrome cheat sheet - Keyboard shortcuts

Windows and Linux Tab and window shortcuts Shortcut Action Alt+F   or   Alt+E   or F10 Opens the Chrome menu   , which lets you customize and control settings in Google Chrome. Ctrl+Shift+B Toggles the bookmarks bar on and off. Ctrl+H Opens the History page. Ctrl+J Opens the Downloads page. Shift+Esc Opens the Task Manager. Shift+Alt+T Sets focus on the first tool in the browser toolbar. You can then use the following shortcuts to move around in the toolbar: ·          Press   Tab, Shift+Tab, Home, End, right arrow,   and   left arrow   to move focus to different items in the toolbar. ·          Press   Space   or   Enter   to activate toolbar buttons, including page actions and browser actions. ·     ...

Magento 2 Bookmark Events

Tổng hợp events có trong magento ,  tạo thêm event bao nhiêu tuỳ thích theo link sau Events and observers