Understanding Magento PHTML

Last modified by JeremyFP on Sat, November 14, 2009 14:30
Source|Old Revisions  |  Back To Group

This document can be used and referenced with the Wiki Article Titled "Understanding Magento CSS"

Header.phtml

Moving The Navigation Menu

The navigation menu is the main row of or column of buttons that help the user navigate to the main parts of your site. In the case of Magento these are usually your store categories, but you can program others manually. The navigation menu is controlled in the header.phtml file. the code can be referenced around [line:42]:

<?php echo $this→getChildHtml(”topMenu”)?>

We can adjust the placement of this by moving this code to another location such as [line:29]

Between <div class=”header-top-container”> and <div class=”header-top”>

If you test this you will notice that the navigation menu relocates itself from just underneath the header where the logo and search bar are to just above the header.

Many designs utilize this top navigation menu.

Moving The Welcome Message

The welcome message is the message displayed on the site that welcomes a user to the website. When guest arrives the message is “Default Welcome Message.” When a user logs in to the site it will welcome the user.

By default the welcome message is located just under the search box. In header.php the default location is around [line:34]:

The code looks like this: <?php echo $this→getWelcome() ?>

You can relocate this code to another area and the location will change corresponding to where you place it.

Removing / Changing Right Column Callout

You will notice that the default template has a back to school ad on the right hand side of the pages. You will without question want to change the ad to match your website’s needs or remove the ad all together.

This ad is placed on the right column from the following file:

/app/design/frontend/default/default/template/callouts/right_col.phtml

In this file you will see div tag with a class of “box.” This is what creates the ad. By deleting this you will remove the add. You can add one back later by simply creating another box div tag.




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs