<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jigar Karangiya</title>
    <description>The latest articles on DEV Community by Jigar Karangiya (@jigarkarangiya).</description>
    <link>https://dev.to/jigarkarangiya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1418490%2Ff00676e0-f5ce-477c-b07f-f5cf748e57c1.jpeg</url>
      <title>DEV Community: Jigar Karangiya</title>
      <link>https://dev.to/jigarkarangiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jigarkarangiya"/>
    <language>en</language>
    <item>
      <title>Patch to Debug Blocks and Containers in Magento 2</title>
      <dc:creator>Jigar Karangiya</dc:creator>
      <pubDate>Thu, 11 Apr 2024 08:18:39 +0000</pubDate>
      <link>https://dev.to/jigarkarangiya/patch-to-debug-blocks-and-containers-in-magento-2-22b6</link>
      <guid>https://dev.to/jigarkarangiya/patch-to-debug-blocks-and-containers-in-magento-2-22b6</guid>
      <description>&lt;p&gt;Hello Devs,&lt;br&gt;
In this tutorial, we will see how to add comments in the page HTML which shows block and template container names.&lt;/p&gt;

&lt;p&gt;Magento provides template hints but its design is too confusing and frustrating. It hurts when you have limited hours to complete your task and are stuck in finding which PHTML file is rendering and which block is responsible for the logic.&lt;/p&gt;

&lt;p&gt;Today, I will share a patch I created to show comments in the page source. It will not affect the front end and not be visible to customers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please do not use this in the production environment, use it only in your local setup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can check comments inside the developer tool of the between and starting of the HTML element.&lt;/p&gt;

&lt;p&gt;Let’s check how.&lt;/p&gt;

&lt;p&gt;Download my patch from the URL below and put it inside the &lt;strong&gt;m2-hotfixes/&lt;/strong&gt; or &lt;strong&gt;Root Directory&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Patch download link :&lt;/strong&gt; &lt;a href="https://gist.github.com/jigarkkarangiya/7a99ffd0049b90e7622e2a5e83c9219c"&gt;https://gist.github.com/jigarkkarangiya/7a99ffd0049b90e7622e2a5e83c9219c&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;It will show the comment on the page below :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3tewtvut6b7p3vjkz8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3tewtvut6b7p3vjkz8i.png" alt="Image description" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it. Now you can easily debug which .phtml file and which block is responsible for rendering the content.&lt;/p&gt;

&lt;p&gt;I hope this article helped you to find what you were looking for.&lt;/p&gt;

&lt;p&gt;Bookmark it for your future reference. Do comment below if you have any other questions on that.&lt;/p&gt;

&lt;p&gt;Do share this trick with your team.&lt;/p&gt;

&lt;p&gt;Thank you. Happy Desiging !!&lt;/p&gt;

</description>
      <category>magento</category>
      <category>magento2</category>
      <category>php</category>
      <category>layouts</category>
    </item>
  </channel>
</rss>
