yireo / magento2-html-hints
Add HTML comment hints with block and container details to the Magento 2 frontend in developer mode
Package info
github.com/yireo/Yireo_HtmlHints
Type:magento2-module
pkg:composer/yireo/magento2-html-hints
Requires
- php: >=8.2 <8.6
- ext-pcre: *
- magento/framework: ^101.0 | ^102.0 | ^103.0
- magento/module-backend: ^101.0 | ^102.0
- magento/module-config: ^101.0 | ^102.0
- magento/module-page-cache: ^100.4
- magento/module-store: ^101.0
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-29 20:46:52 UTC
README
A simple Magento 2 module that - once enabled - adds HTML hints to the frontend
This module adds HTML hints (HTML comments <!-- -->) to the HTML output of a page, adding details on the rendered block or container.
Installation
composer require yireo/magento2-html-hints bin/magento module:enable Yireo_HtmlHints
Configuration
HTML hints are disabled by default. Enable them via Stores > Configuration > Advanced > Developer > HTML Hints > Enabled. Note that the Developer section is only visible in the Admin Panel when Magento runs in developer mode. Alternatively, use the CLI:
bin/magento config:set dev/html_hints/enabled 1
Changing this setting in the Admin Panel requires the Magento_Config::dev admin permission (Stores > Configuration > Developer section).
Notes:
- Hints are only added when Magento is running in developer mode, even when the setting is enabled.
- Hints are only added while a storefront page result is rendered. They are skipped for AJAX requests, for layouts other than the main page layout and for emails.
- While hints are active, the full page cache and the block HTML cache are disabled, so hinted output is never stored in or served from these caches. After disabling hints, flush the caches with
bin/magento cache:flush.
Usage
Before:
<div class="page-title-wrapper"> <h1 class="page-title" id="page-title-heading" aria-labelledby="page-title-heading toolbar-amount"> <span class="base" data-ui-id="page-title-wrapper">Example</span> </h1> </div>
After:
<!-- BLOCK CLASS: Magento\Theme\Block\Html\Title\Interceptor / BLOCK NAME: page.main.title / TEMPLATE NAME: Magento_Theme::html/title.phtml / TEMPLATE FILE: /var/www/html/vendor/magento/module-theme/view/frontend/templates/html/title.phtml --> <div class="page-title-wrapper"> <h1 class="page-title" id="page-title-heading" aria-labelledby="page-title-heading toolbar-amount"> <span class="base" data-ui-id="page-title-wrapper">Example</span> </h1> </div> <!-- END BLOCK page.main.title -->