I have a magento website with multi store and i have been able to add the home link on the default store. the whole site along with its multi stores shares the same theme but in the theme i edited template/page/navigation/top.php with the code
<?php
$_anyActive = false;
foreach ($this->getStoreCategories() as $_category)
{
$_anyActive = $_anyActive || $this->isCategoryActive($_category);
}
?>
<li class="home <?php echo !$_anyActive ? 'active' : '' ?>">
<a href="<?php echo $this->getUrl('')?>"><span><?php echo $this->__('Home') ?></span></a>
</li>
This code now makes the home link shows but now its only shows in the default store but i want it to show in all other stores, i dont understand this but as they whole stores shares the same theme, i thought maybe they should also be able to read this code and display the home link, i could duplicate the themes and then assign them to each store (which i’m not even sure would work) but that would make the code deficult to maintain as i though if they share the same design, i could just make one change and reflect on the entire sub stores.
The following is the content of template/page/navigation/top.php
<?php $_menu = ''?>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $_menu .= $this->drawItem($_category) ?>
<?php endforeach ?>
<?php if ($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php $_anyActive = false; foreach ($this->getStoreCategories() as $_category) { $_anyActive = $_anyActive || $this->isCategoryActive($_category); } ?>
<li class="home <?php echo !$_anyActive ? 'active' : '' ?>"><a href="<?php echo $this->getUrl('')?>"><span><?php echo $this->__('Home') ?></span></a></li>
<?php echo $_menu; ?>
</ul>
</div>
<?php endif; ?>
I hope you are able to help me solve this problem
I guess the problem is that you put your home link inside of main navigation. As your secondary stores don’t have any navigation, the whole unordered list has not been generated.
Try this: