04.07.2019 Views

frontend-developer-1

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Create and Customize Template Files<br />

HELPFUL LINKS:<br />

• https://devdocs.magento.com/guides/v2.2/<strong>frontend</strong>-dev-guide/<br />

templates/template-override.html<br />

How does that influence upgradability?<br />

While the chances are usually slim, there can be broken functionality that occurs<br />

when upgrading. The reason is that the template that was overridden may have<br />

been enhanced along with other aspects of the system that depended on the<br />

template. If the overridden template is not upgraded, things can break.<br />

The most notorious example was from Magento 1 days. SUPEE-9767 enabled form<br />

key checking on the checkout. With the patch, Magento added the form key to the<br />

templates. But many checkouts had at least some customized template files which<br />

then did not include the form key. While this was easy to catch with testing, it added<br />

to the overall implementation time for this upgrade.<br />

How can you determine which template a block renders?<br />

The easiest way is to enable template hints, which can be activated using the<br />

command-line: bin/magento dev:template-hints:enable or in the admin<br />

area, in the follow location:<br />

Frontend:<br />

Stores > Settings > Configuration > Advanced > Developer > Debug > Enabled<br />

Template Path Hints for Storefront > Yes<br />

Copyright © 2018, SwiftOtter, Inc.<br />

50

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!