One interesting thing about Magento 2’s refactored layout system is how it enables multiple XML trees modifying one global structure object. The layout builder for page objects #File: vendor/magento/framework/View/Page/Builder.php protected function generateLayoutBlocks() { $this->readPageLayout(); return [...]
astorm
Magento 2’s remove Tag Stack Exchange answer covering where Magento 2’s layout remove=“1” attribute tag is implemented. Short version – the block/container reader/scheduler classes look for it, and then tell the scheduler there’s an item to remove from the layout. Then, when the Generator pool builds [...]
astorm
One recent Magento 2 discovery that caught me off guard is, per the dev docs site, the <action/> method tag is depreciated The <action> instruction is deprecated. If the method implementation allows, use the <argument> for <block> or <referenceBlock> to access block public API. Given this, it sort of makes [...]
astorm
I’m starting to get a handle on how Magento 2 renders a layout and how those changes will impact folks to spend their day in layout handle XML files. This one’s mainly for myself – posting it here to get it out of my head. The first step of layout rendering in Magento 2 is still building a “package layout” [...]
astorm
The app/etc/config.php file contains a list of all the modules in Magento that have been enabled/disabled. It’s also the master list for module ordering – i.e. Magento references this file when deciding what order to load configuration files in. The order of modules in app/etc/config.php is, itself, determined by the [...]
astorm
Magento 2: Sequence Gotcha A little bit of the old derp form yours truly. Magento 2’s module.xml file contain a <sequence/> node that acts like the old <depends/> from Magento 1’s app/etc/modules declaration files. There’s a small catch though – in order to make Magento recognize changes to your [...]
astorm
Mage2Katas Screencast demonstrations from Vinai Kopp covering TDD methods in Magento 2. Watching an experienced developer work (the “code katas” approach) can be super useful – it’s one thing to read “you should do X”, but when you watch someone “do X” understanding can rapidly click in.
astorm
Welcome to your fortnightly “Open Magento 2 Technical Questions” post. If you’ve got an answer to any of the following please use the provided Stack Exchange thread to answer, or say hello via email if public communication isn’t possible. First off, we’ve got a slew of new questions. After that, some follow [...]
astorm
Last week we covered RequireJS, which is the foundational framework for Magento 2's modern approach to javascript. Today we're going to do the same for Magento 2's use of cascading style sheets.
astorm
This one deserves a longer post, but my schedule is not forgiving. This assumes you’ve read and understand the concepts from my Magento object manager series. Many Magento provided classes have a special context object in their constructor. #File: vendor/magento/module-catalog/Controller/Product/View.php //... use [...]
astorm
Magestead – A Vagrant LEMP Stack for Magento Developers Magestead looks like another contender in the “geting a Magento 2 system up and running using vagrant and VMs”. Homestead inspired, it may be worth checking out.
astorm
Request: .user.ini files for FPM config · Issue #705 · magento/magento2 Somehow I’d always assumed nginx worked hard to be apache compatible. It doesn’t sound like that’s the case, which is a shame. I also found this on the official nginx wiki Stop using .htaccess. It’s horrible for performance. NGINX is designed to be [...]
astorm
For over a decade I’ve kept most my development work confined to the physical Macintosh OS X laptop I use every day, running server software using the OS X unix/bsd/darwin internals. I pick a stable version of PHP and install the php-osx package (previously the entropy.ch package), install MySQL via MySQL/Oracle’s OS X [...]
astorm
I’m not super conversant in the less CSS preprocessor, so I’m not sure how useful they are, but Magento 2 ships with some useful looking UI library docs in lib/web/css/docs/index.html You won’t be able to browse to these files via HTTP – you’ll need to open them directly in a web browser.
astorm
Magento 2 Marketplace Upload Validation Tool (Quick Note) Magento’s lead architect, Alan Kent, just posted a small command line program to validate a “composer zip archive” for Magento Marketplace. Magento Marketplace is the replacement for Magento Connect, and although its details remain a secret, its assumed to be an [...]
astorm
Now that we've covered the basics of including javascript and CSS files in Magento 2, we're going to start exploring Magento's adoption of modern front end tools and libraries.
astorm