Page 1 of 1

Home button in main horizonal nav

Posted: Thu Mar 01, 2012 9:11 am
by xtreme
Is there a way to add a HOME button to the main horizonal nav?
I tried it using the categories along with the mod that takes out product count but that just left a space below the cat/product page that says HOME.

Re: Home button in main horizonal nav

Posted: Thu Mar 01, 2012 11:25 am
by george_o
You have to edit catalog/theme/yourtheme/template/common/header.tpl and search for:

Code: Select all

<div id="menu">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>
Replace with:

Code: Select all

<div id="menu">
  <ul>
  	<li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>

Re: Home button in main horizonal nav

Posted: Sat Mar 03, 2012 7:29 am
by xtreme
Thanks George.

Re: Home button in main horizonal nav

Posted: Sat Mar 03, 2012 8:04 am
by xtreme
Worked absolutly great!
Thanks again.