Understanding Magento PHTML

Last modified by NE Computer on Sun, December 21, 2008 19:23
Source|Old Revisions  |  Back To Group

This is an old revision of the document!


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 controlled in the header.phtml file. the code can be referenced as [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]

Original Code: <div class=”header-top-container”> <div class=”header-top”> <h1 id=”logo”><a href=”<?php echo $this→getUrl(’ ‘) ?>”><img src=”<?php echo $this→getLogoSrc() ?>” alt=”<?php echo $this→getLogoAlt() ?>” /></a></h1> <p class=”no-display”><a href=”#main”><strong><?php echo $this→(’Skip to Main Content’) ?> &raquo;</strong></a></p> <?php echo $this→getChildHtml(’topSearch’) ?> <div class=”quick-access”> <?php echo $this→getWelcome() ?><br /> <div class=”shop-access”> <?php echo $this→getChildHtml(’topLinks’) ?> </div> <?php echo $this→getChildHtml(’store_language’) ?> </div> </div> </div> <?php echo $this→getChildHtml(’topMenu’) ?> New Code: <div class=”header-top-container”> <?php echo $this→getChildHtml(’topMenu’) ?> <div class=”header-top”> <h1 id=”logo”><a href=”<?php echo $this→getUrl(’ ‘) ?>”><img src=”<?php echo $this→getLogoSrc() ?>” alt=”<?php echo $this→getLogoAlt() ?>” /></a></h1> <p class=”no-display”><a href=”#main”><strong><?php echo $this→(’Skip to Main Content’) ?> &raquo;</strong></a></p> <?php echo $this→getChildHtml(’topSearch’) ?> <div class=”quick-access”> <?php echo $this→getWelcome() ?><br /> <div class=”shop-access”> <?php echo $this→getChildHtml(’topLinks’) ?> </div> <?php echo $this→getChildHtml(’store_language’) ?> </div> </div> </div> NOTE: A few spaces have been added in a few locations because of the wiki formating.

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.




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs