magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

More robust template path hints (block name, block parents

Open erikhansen opened this issue 12 years ago • 40 comments

Currently, the "template path hint" feature displays the template name and block class name.

Fabrizio Branca's Aoe_TemplateHints module extends the native Magento 1.x template path hint functionality to add much more information to the hints including:

  • Block name (very useful)
  • Parent block names
  • Module
  • Caching status

Here is a screenshot from his blog post, visualizing what this could look like: jpeg

I propose that this functionality be built into Magento 2. If Magento accepts this proposal, I may be willing to build this functionality and then issue a pull request to have it incorporated into Magento 2.

erikhansen avatar May 16 '14 00:05 erikhansen

@fbrnc Would you be willing to change the license type of Aoe_TemplateHints to MIT to allow code from that module to be ported to Magento 2? You've done a great job with this module and I'd like to be able to reference and port code from that module.

erikhansen avatar May 16 '14 00:05 erikhansen

@erikhansen, thank you for the idea! The PO responsible for this area will look at your suggestion and we will figure out what to do. Anyway, the ticket is in the product backlog now. Let's see what we can do about the suggestion you are offering.

verklov avatar May 27 '14 17:05 verklov

@verklov Thanks. I would be interested in contributing to the development of this, if it is something that Magento would be willing to include in the core.

erikhansen avatar May 27 '14 22:05 erikhansen

@erikhansen Thank you for the great idea! I will include it into our roadmap

tkacheva avatar May 29 '14 09:05 tkacheva

@tkacheva If I worked on this feature and submitted a pull request, would it get included into Magento 2?

erikhansen avatar May 29 '14 20:05 erikhansen

:+1:

mhhansen avatar May 29 '14 20:05 mhhansen

@erikhansen Yes, for sure if it passes code review and meets our license policy

tkacheva avatar Jun 02 '14 15:06 tkacheva

Internal ticket: MAGETWO-24798

vpelipenko avatar Jan 29 '15 12:01 vpelipenko

I must have missed this ticket in the first place. Yes, I'd totally love to see a template hints like the ones I implemented for Aoe_TemplateHints in Magento 2 and I'd also be willing to contribute that code. One of the important benefits of Aoe_TemplateHints over the native ones is that Aoe_TemplateHints does not only show blocks inheriting from Mage_Core_Block_Template, but all blocks (inheriting from Mage_Core_Block_Abstract). That's an important detail :)

fbrnc avatar Jan 29 '15 17:01 fbrnc

I checked internally, only to be reminded that this was already approved above by @tkacheva mid last year. So if someone is willing to work on this (based on AOE code as starting point - thanks Fabrizio!), could interested parties leave a note on this issue to coordinate work between you.

alankent avatar Feb 02 '15 19:02 alankent

I would be willing to work on this issue. Is it still up for grabs?

ryanstreet avatar May 28 '15 22:05 ryanstreet

@ryanstreet yes, it is still up for grabs, as far as I know. It would be great if you wanted to work on it.

erikhansen avatar Jun 02 '15 14:06 erikhansen

Awesome. I'm on it!

ryanstreet avatar Jun 02 '15 16:06 ryanstreet

Great @ryanstreet

piotrekkaminski avatar Jun 02 '15 16:06 piotrekkaminski

Thanks @ryanstreet. Looking forward this great module in Magento 2.

vpietri avatar Jun 30 '15 12:06 vpietri

Your welcome!

ryanstreet avatar Jul 01 '15 15:07 ryanstreet

I don't have time to work on this right now, but just pitched in a $25 bounty.

erikhansen avatar Jan 07 '16 17:01 erikhansen

Unless someone can get to it sooner, I have this fix slotted in my schedule for February 16. If someone else can get to it, by all means do so.

ryanstreet avatar Jan 12 '16 21:01 ryanstreet

@ryanstreet It would be awesome if you could take this on in February. Frontend developers will thank you for years to come. The Aoe_TemplateHints extension is pretty robust and does quite a bit more than what I think we could reasonably expect to be included in the Magento core.

If I were you, I would target adding this functionality to core Magento: In addition to the block class and template file, add the block name and block alias to the template hints.

I'm not sure if you've submitted any pull requests for Magento 2, but you'll need to keep in mind that Magento expects integration/unit tests to be included in any pull request. You can read up here on how to get Magento's native tests running on your development environment: http://davidalger.com/development/magento/running-the-magento-2-test-suite/ Since Magento should already have tests in place to verify the existing template hints functionality, it shouldn't be too difficult to expand upon those tests to cover the new functionality.

Here is my suggestion of how to change the config:

configuration___settings___stores___magento_admin

Here is a suggestion for how you might add the block name and class:

shopping_cart

You'll want to test with all combinations of settings and block combinations (e.g., blocks with no names but aliases, etc)

erikhansen avatar Jan 14 '16 21:01 erikhansen

I would love to see this tool improved, or a better version created as a module. It just struggles to get high enough on the list compared to other features internally. Should we fix checkout or the hints too? Checkout! Should we fix payments integration or the hints tool? Payments! This sort of project I think would make a great community contribution.

alankent avatar Jan 14 '16 23:01 alankent