Locate block templates in Magento
Learn how to locate Magento block templates using CSS classes, data bind attributes, PhpStorm search and grep.
Lesson Content
When we created our blog post detail and sidebar templates, we wrapped the contents of these templates within a div, and specified a class for each element. When we inspect these elements with the browser dev tools, we will confirm this is outputted to the browser. Doing this allows your future self and others to easily locate where this is located on the filesystem.
We already know where these two templates are located, but letβs try to find a template that we do not know where it is located. Letβs inspect this Compare Products block. If we go up the DOM tree, we can see that it is located w...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.