Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:cache:litemage:customization:separate-front-page-footer [2015/12/21 17:32]
Michael Alegre created
litespeed_wiki:cache:litemage:customization:separate-front-page-footer [2016/05/06 13:53] (current)
Long Hu
Line 1: Line 1:
 ====== Using A Separate Footer On Your Front Page ====== ====== Using A Separate Footer On Your Front Page ======
  
-Some websites use a separate footer containing extra information (usually for SEO purposes) on their front page. This is usually done by determining if the current page is the homepage in the footer template and then treating that footer differently. This dynamic logic makes the footer cache unfriendly, as LiteMage will punch a hole for the "​footer"​ block as a public block. This means that whichever version of the footer, specialized or not, LiteMage encounters first will be be the version that is served on every page.+Some websites use a separate footer containing extra information (usually for SEO purposes) on their front page. This is usually done by determining if the current page is the homepage in the footer template and then treating that footer differently. This dynamic logic makes the footer cache unfriendly, as LiteMage will punch a hole for the "​footer"​ block as a public block. This means that whichever version of the footer, specialized or not, LiteMage encounters first will be the version that is served on every page.
  
 **For Example:** **For Example:**
 +
 +In the existing footer template "​footer.phtml",​ there is a PHP script that dynamically determines whether the current page is the home page.
 +
   <?php   <?php
   $page = Mage::​app()->​getFrontController()->​getRequest()->​getRouteName();​   $page = Mage::​app()->​getFrontController()->​getRequest()->​getRouteName();​
Line 36: Line 39:
        ...        ...
      </​block>​      </​block>​
-</​reference></​code>​ This removes the old footer block and adds the newly created homefooter.phtml template for the home page. \\ \\ **Note:** The block name used here has to be unique, but the alias must remain the same as to not interfere with any applied logic. Thus, it is very important to include name="​homefooter"​ as="​footer"​+</​reference></​code>​ This removes the old footer block and adds the newly created homefooter.phtml template for the home page. \\ \\ **Note:** The block name used here has to be unique, but the alias must remain the same as to not interfere with any applied logic. Thus, it is very important to include name="​homefooter"​ as="​footer"​.
  
 **Note:** **Blocks HTML output** should remain disabled under System >> Cache Management in the Magento Admin Panel. **Note:** **Blocks HTML output** should remain disabled under System >> Cache Management in the Magento Admin Panel.
  
  • Admin
  • Last modified: 2015/12/21 17:32
  • by Michael Alegre