O'Reilly logo

OpenCart Theme and Module Development by Rupak Nepali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the code in header.tpl

The header.tpl file is at the catalog/view/theme/THEMENAME/template location, and it contains all the links of CSS and JavaScript files. The same header is shown for all the pages, so we describe the code in header.tpl. Go to catalog/view/theme/packttheme/template and open the header.tpl file and add this to the file:

<!DOCTYPE html>

OpenCart follows the HTML5 DOCTYPE declarations, and <!DOCTYPE html> goes at the top of every HTML5 page. The HTML5 word <!DOCTYPE html> means that this page is written in HTML5:

<!--[if IE]><![endif]--> <!--[if IE 8 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" class="ie8"><![endif]--> <!--[if IE 9 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required