H&O Magento 2 Advanced Template Hints module

Overview

H&O Magento 2 Advanced Template Hints module

Overview

Ho_Templatehints extends the default Magento template hints.

  • Easily accessible with muscle memory ?ath=1.
  • Shows hints for Templates, AbstractBlocks (Blocks), Containers and UI Components.
  • No layout interference: Using css outline instead of borders of other HTML elements, so it doesn't f'up the layout.

Usage $0

Installation

composer require --dev honl/magento2-templatehints
php bin/magento module:enable Ho_Templatehints
php bin/magento setup:upgrade

Development installation (git enabled)

composer require --dev honl/magento2-templatehints "dev-master"
php bin/magento module:enable Ho_Templatehints
php bin/magento setup:upgrade

Configure PHPStorm, allow remote calls

Setting up PHPStorm

Usage

  1. Set your Magento 2 installation to developer mode (when in production mode make sure to add your IP address in Developer Client Restrictions).
  2. Add ?ath=1 to your URL to activate.
  3. Open up your console in you Chrome/Firefox/Safari/IE devtools.
  4. hold (shift)
  5. Hover over the element you wish to inspect
  6. Voila! Hints everywhere!

Hints for hidden elements

You can't show hints for a hidden element, for that purpose there is hint($0):

//Select an element in the Elements panel in your devtools, it is now available with $0
hint($0)

Console $0

Inner Workings

The module adds an additional HTML attribute to the outer most element of a layout element.

Credits

Inspiration from Aoe_TemplateHints and a lot of love from H&O.

Developer

This module was developed by the H&O team. Check out more about this module on the H&O website: H&O Magento 2 Advanced Template hints module

Comments
  • Fixed incorrect package name in composer require command

    Fixed incorrect package name in composer require command

    Fixed an incorrect package name in the composer require command which prevented users from installing the module according to the information in the README.md file.

    opened by royvanos 7
  • PHP 7.3 support

    PHP 7.3 support

    Magento 2.3.3 supports PHP 7.3. Is it possible to add this version in the composer.json?

    https://devdocs.magento.com/guides/v2.3/release-notes/release-notes-2-3-3-open-source.html

    opened by bartdelvaux 6
  • PHP requirements don't match Magento 2.4.4

    PHP requirements don't match Magento 2.4.4

    Preconditions

    1. Magento 2.4.4

    Steps to reproduce

    1. Run composer require-commerce --dev honl/magento2-templatehints

    Expected result

    1. No error is thrown
    2. The module is installed

    Actual result

    1. The following error is thrown because of PHP ~ 7.1 in the composer.json requirements while Magento 2.4.4 requires PHP >= 8.1:
    Package honl/magento2-templatehints has requirements incompatible with your PHP version, PHP extensions and Composer version:  
        - honl/magento2-templatehints 0.2.5 requires php ~7.1 which does not match your installed version 8.1.1.
    
    opened by Axel29 4
  • Error during compile

    Error during compile

    Run

    php magento setup:di:compile
    

    During the step - Interceptors cache generation... return Error:

    Ho\Templatehints\Block\Hints\Init
            Incorrect dependency in class Ho\Templatehints\Block\Hints\Init in /Applications/XAMPP/xamppfiles/htdocs/magento2data/vendor/ho-nl/magento2-templatehints/Block/Hints/Init.php
    \Magento\Framework\View\Asset\Repository already exists in context object
    Total Errors Count: 1
    Errors during compilation:
        Ho\Templatehints\Block\Hints\Init
            Incorrect dependency in class Ho\Templatehints\Block\Hints\Init in /Applications/XAMPP/xamppfiles/htdocs/magento2data/vendor/ho-nl/magento2-templatehints/Block/Hints/Init.php
    \Magento\Framework\View\Asset\Repository already exists in context object
    Total Errors Count: 1
    Errors during compilation:
        Ho\Templatehints\Block\Hints\Init
            Incorrect dependency in class Ho\Templatehints\Block\Hints\Init in /Applications/XAMPP/xamppfiles/htdocs/magento2data/vendor/ho-nl/magento2-templatehints/Block/Hints/Init.php
    \Magento\Framework\View\Asset\Repository already exists in context object
    Total Errors Count: 1
    
    bug 
    opened by PixelT 4
  • PHP version support

    PHP version support

    I think in README, we should state which version the module were tested with. But in composer we should allow any PHP version which likely working with instead of fixing specific versions because our module keep out of dated than PHP version update.

    For now, please update composer to support any PHP 7.2.x

    opened by onlinebizsoft 3
  • Other js events prevent output in console

    Other js events prevent output in console

    I have a magento 2.2.6 installation. Shift clicking on a product image opens up the light box view of the product image, not logging any output to the console.

    The same seems to be true for buttons having click events.

    opened by UB3RL33T 2
  • Syntax Error

    Syntax Error

    I get the folowing error after installation via Composer.

    Parse error: syntax error, unexpected '?' in /magento/vendor/honl/magento2-templatehints/Plugin/View/LayoutPlugin.php on line 150

    I followed the steps in the readme

    opened by turtlecreations 1
  • Use the $proceed() method to wrap around the layout rendering.

    Use the $proceed() method to wrap around the layout rendering.

    Slack chat:

    @paales: How about using the $proceed closure to generate the view elements content, instead of calling the methods on the elements directly? Just saying, since not calling $proceed can break other around plugins. (edited)

    enhancement 
    opened by paales 1
  • Wrong URL in the remote call (Docker)

    Wrong URL in the remote call (Docker)

    When running in docker, the project is mapped to different folders. It woul be nice to be able to define the root magento path.

    Example: In my case, the remote call points to http://localhost:63342/api/file//var/www/html/vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml The correct one would be http://localhost:63342/api/file/src/vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml

    Note there's no extra / and the paths are different in the project. It's impossible to predict, but making it configurable would help.

    PS: Congratulations for the amazing work with the module. It helps a lot.

    opened by r-martins 0
  • Installation not successfull

    Installation not successfull

    I get

    Error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\AbstractResource in /var/www/hausfux/m2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php

    You also need to execute php bin/magento setup:di:compile

    opened by Eddcapone 0
  • Problem with HTML parsing

    Problem with HTML parsing

    We have the following HTML

    <!--Authentication Pop-Up-->
    </div></header><div x-data="initHeaderNavigation()"
     x-init="$watch('activeSubmenuId', value => activateSubmenuMobile(value))"
    

    The module inserts the hint like this

    <!--Authentication Pop-Up-->
    </div></header><div x-data="initHeaderNavigation()"
     x-init="$watch('activeSubmenuId', value = data-ho-hinttype="block" ....
     @menu-back.window="back"
     class="relative z-50 font-bold bg-gray-200 lg:block lg:z-40"
    

    Reason: We should not parse HTML with regex https://github.com/ho-nl/magento2-Ho_Templatehints/blob/master/Plugin/View/LayoutPlugin.php#L117

    Related to Hyvä, because we use Alpine JS there and these notations are common

    https://gitlab.hyva.io/hyva-themes/hyva-compat/magento2-ho-templatehints/-/issues/2

    opened by amenk 3
  • Bug/Idea suggestion

    Bug/Idea suggestion

    Opening in PhpStorm simply doesn't work anymore, regardless the configuration allowing unsigned requests when using docker.

    It's just because the FILE is different then the file in my local machine. For example: http://localhost:63342/api/file//var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/form.phtml

    The correct url would be http://localhost:63342/api/file/src/vendor/magento/module-catalog/view/frontend/templates/product/view/form.phtml

    Adding some option to map or replace the url properly would be very nice.

    opened by r-martins 0
  • Not working in checkout success

    Not working in checkout success

    You can't use the extension on the checkout success page. If you add the parameter ?ath=1 to the checkout then it gets automatically removed in checkout success.

    opened by Eddcapone 0
Releases(0.3.0)
Owner
Reach Digital
Design en ontwikkelbureau voor e-commerce
Reach Digital
Add scalar type hints and return types to existing PHP projects using PHPDoc annotations

PHPDoc to Type Hint Archived! This repository is now archived. Consider using PHP CS Fixer (and especially the phpdoc_to_param_type and phpdoc_to_retu

Kévin Dunglas 228 May 22, 2022
Magento 2 Module Experius Page Not Found 404. This module saves all 404 url to a database table

Magento 2 Module Experius Page Not Found 404 This module saves all 404 urls to a database table. Adds an admin grid with 404s It includes a count so y

Experius 28 Dec 9, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
PaaS template based on production template using platform.sh

Shopware for Platform.sh This template builds Shopware on Platform.sh using Composer. To get started on Platform.sh, please visit https://docs.platfor

Shopware 9 Oct 12, 2022
PDF API. JSON to PDF. PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data

PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data PDF ENGINE VERSION: development: This is a prerelease version

Ajous Solutions 2 Dec 30, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Michael Pratt 307 Dec 23, 2022
An advanced Mute Assistant to mute players.

IMPORTANT This plugin does not include AI Please follow me for more better projects :) MuteAssistant Mute players using a simple menu This plugin is s

Daniel Hex 3 Mar 26, 2022
Advanced algorithmic PHP applications I've made

Advanced algorithmic PHP applications I've made

Deniz Uku 1 Nov 2, 2021
Messaging solutions for PHP - It contains advanced features build on top of a transport component

It contains advanced features build on top of a transport component. Client component kind of plug and play things or consumption component that simplify message processing a lot. Read more about it in documentation.

Enqueue 175 Jan 3, 2023
A PocketMine plugin with advanced world tools and maybe can beat MultiWorld

WorldTools A PocketMine plugin with advanced world tools and maybe can beat MultiWorld This plugin is on development! Helping me with pull request may

Keenan Yafiq 2 Aug 16, 2022
Advanced Custom Fields Contact Form Extension (Beta)

Advanced Custom Fields Contact Form Extension (Beta) This is an extension for Advanced Custom Fields 5 for Wordpress, which enables you to create a co

Christine Pham 61 Oct 6, 2022
An advanced plugin to manage events when the player enters the server!

⭐ • Better Join Version Status Date 1.0.0 stable-dev 12/10/2022 ?? • General: Plugin Introduction: This is an advanced player input management plugin

HenryDM 3 Nov 2, 2022
HTML5 Twitter Bootstrap 3.1 Magento Boilerplate Template

Magento Boilerplate A HTML5 Twitter Bootstrap 3.1 Magento 1.8 Boilerplate Template Read the blog post or checkout the demo for more information. Insta

null 531 Dec 8, 2022
PHPStorm Live template preferences for Magento 2 Projects

Magento 2 PHPStorm Preferences This project is intended to setup useful PHPStorm Templates for Magento 2 Projects. Disclaimer This project overrides t

Stämpfli AG 229 Jul 18, 2022
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

netz98 758 Dec 28, 2022
Content Fuzzyfyr Module for Magento® 2

Content Fuzzyfyr Module for Magento® 2 The Content Fuzzyfyr module for Magento® 2 fills up empty content fields - and if needed - switches real conten

Hive Commerce 11 Oct 17, 2022