Improved Magento 2 debug hints for layout and blocks
Features:
This package is not intended to be used in production.
composer require --dev kingfisherdirect/magento2-better-debug-hints
bin/magento setup:upgrade
Open your Magento page with an extra GET parameter ?ath=1
. For example:
https://localhost/?ath=1
.
Element Picker
`
(backtick key, above tab)ESC
to disable pickerConsole Helper
Use layout()
function to investigate any HTML element. To inspect currently selected element in inspector use layout($0)
Graphviz Layout
Run lh.debuggers.mageLayout.graph()
in developer tools console. Graph will be copied into clipboard. You can visualise it online here - http://magjac.com/graphviz-visual-editor/ or using this command echo 'GRAPH_OUTPUT' | dot -Tsvg > output.svg
https://github.com/ho-nl/magento2-Ho_Templatehints
After starting work on this module I realised there is an existing one that seems quite good. Few ideas were taken out of that module.