CRE Loaded main_page.tpl.php

This entry is part of 2 in the series Template Structure

From top to bottom

main_page.tpl.php
This file is the overall template holder.. this is used in all pages of your site (unless you have a very unique template that uses multiple main_page file)
The doctype declaration instructs the web browser about what version of the markup language the page is written in.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

The head element

<head>

is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets,
provide meta information, and more.

The following tags can be added to the head section: <base>, <link>, <meta>, <script>, <style>,  and <title>.

The <title> tag defines the title of the document, and is the only required element in the head section! in CRE Loaded, this is pulled from the includes/header_tags.php. There is a flaw with this logic, nowhere can you assign just home page tags without using the sites default tags (meta tags that appear on all pages)

To work around this, replace

<?php
if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
} else {
  ?>
  <title><?php echo TITLE ?></title>
  <?php
}
?>

with

<?php
$currentpage = $_SERVER['REQUEST_URI'];
if($currentpage=='/index.php' OR $currentpage=='/index.html' OR $currentpage=='/') {
echo '<title>CRE Loaded Expert - Service, Support, Hosting, Templates </title>';
echo '<meta name="Description" content="CRE Loaded Expert provides service, support, hosting and templates for your creloaded store">'; }
else {
if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
    }
}
?>

If your creloaded is in a subfolder (not the root) you will need to modify line 3 above with the correct path
ie

 if($currentpage=='/catalog/index.php' OR $currentpage=='/catalog/index.html' OR $currentpage=='/catalog/') {

Meta tags

Series Navigation

No related posts.

About: Jason

this is my info, you can not have it