0

Have some strange header.phtml error. Problem is non my index page everything is ok, and on any other page have some weird problem my header and menu change places.

code for my current header.phtml is this.

<div class="header-container">
<header class="container main-header">
    <?php if ($this->getIsHomePage()):?>
        <h1 class="logo four columns alpha">
        <strong><?php echo $this->getLogoAlt() ?></strong>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo">
        <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
        </a>
        </h1>
    <?php else:?>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo">
        <strong><?php echo $this->getLogoAlt() ?></strong>
        <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
        </a>
    <?php endif?>
    <div class="quick-access seven columns offset-by-one omega">
        <?php echo $this->getChildHtml('topSearch') ?>
        <?php echo $this->getChildHtml('topLinks') ?>
        <?php echo $this->getChildHtml('store_language') ?>
    </div>
    <h5 class="welcome-msg" align="center"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></h5>
    <?php echo $this->getChildHtml('topContainer'); ?>
</header>
</div>
<?php echo $this->getChildHtml('topMenu') ?> 

Ok code on my generated index page look like this.

<div class="header-container">
<header class="container main-header">
            <h1 class="logo four columns alpha"><strong></strong>
            <a href="http://local.magehive/index.php/" title="" class="logo">
            <img src="http://local.magehive/skin/frontend/levelup/default/images/logo.png" alt="">
            </a>
            </h1>
            <div class="quick-access seven columns offset-by-one omega">
        <form id="search_mini_form" action="http://local.magehive/index.php/catalogsearch/result/" method="get">
<div class="form-search">
    <label for="search">Search:</label>
    <input id="search" type="text" name="q" value="" class="input-text" maxlength="128" autocomplete="off">
    <button type="submit" title="Search" class="button"><span><span>Search</span></span></button>
    <div id="search_autocomplete" class="search-autocomplete" style="display: none;"></div>
    <script type="text/javascript">
    //<![CDATA[
        var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Search entire store here...');
        searchForm.initAutocomplete('http://local.magehive/index.php/catalogsearch/ajax/suggest/', 'search_autocomplete');
    //]]>
    </script>
</div>
</form>
        <ul class="eight columns links">
                    <li class="first"><a href="http://local.magehive/index.php/customer/account/" title="My Account">My Account</a></li>
                    <li><a href="http://local.magehive/index.php/wishlist/" title="My Wishlist">My Wishlist</a></li>
                    <li><a href="http://local.magehive/index.php/checkout/cart/" title="My Cart" class="top-link-cart">My Cart</a></li>
                    <li><a href="http://local.magehive/index.php/checkout/" title="Checkout" class="top-link-checkout">Checkout</a></li>
                    <li class=" last"><a href="http://local.magehive/index.php/customer/account/login/" title="Log In">Log In</a></li>
        </ul>
                </div>
    <h5 class="welcome-msg" align="center">Moze poruka a ne mora da stoji </h5>
        </header>

But code generated on other pages look like this for example contact

<div class="header-container">
<header class="container main-header">
            <a href="http://local.magehive/index.php/" title="" class="logo"><strong></strong>
            <img src="http://local.magehive/skin/frontend/levelup/default/images/logo.png" alt=""></a>
            <div class="quick-access seven columns offset-by-one omega">
        <form id="search_mini_form" action="http://local.magehive/index.php/catalogsearch/result/" method="get">
<div class="form-search">
    <label for="search">Search:</label>
    <input id="search" type="text" name="q" value="" class="input-text" maxlength="128" autocomplete="off">
    <button type="submit" title="Search" class="button"><span><span>Search</span></span></button>
    <div id="search_autocomplete" class="search-autocomplete" style="display: none;"></div>
    <script type="text/javascript">
    //<![CDATA[
        var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Search entire store here...');
        searchForm.initAutocomplete('http://local.magehive/index.php/catalogsearch/ajax/suggest/', 'search_autocomplete');
    //]]>
    </script>
</div>
</form>
        <ul class="eight columns links">
                    <li class="first"><a href="http://local.magehive/index.php/customer/account/" title="My Account">My Account</a></li>
                    <li><a href="http://local.magehive/index.php/wishlist/" title="My Wishlist">My Wishlist</a></li>
                    <li><a href="http://local.magehive/index.php/checkout/cart/" title="My Cart" class="top-link-cart">My Cart</a></li>
                    <li><a href="http://local.magehive/index.php/checkout/" title="Checkout" class="top-link-checkout">Checkout</a></li>
                    <li class=" last"><a href="http://local.magehive/index.php/customer/account/login/" title="Log In">Log In</a></li>
        </ul>
                </div>
    <h5 class="welcome-msg" align="center">Moze poruka a ne mora da stoji </h5>
        </header>

For some reason on any other page header.phtml dont generate this code and this is something I cannot find where it is the problem. Didint change anything in my local.xml file and looked in CMS pages and everything is ok there.

My question is this where did I make mistake and if so can I solve this. Tried creating again header.phtml and nothing everything is the same.

10x for any tip or help on this.

0

3 Answers 3

0

I think you should look at your css file to check where the problem is. So, the problem is that on index frontend page, header and menu sort order is different than on all other pages?

I think that you have some styling on <h1 class="logo four columns alpha">.

2
  • Yes on all other pages from some reason there is missing h1 tag and that were problem comes out. Checked and recheck everything but really annoy me . Code on generated index page is ok and like it should be with 2 columns layout , have some other pages with 2 or 3 columns layout and everywhere except home page are mess up. Even I tried to create hew header and how use still same error. Commented Dec 4, 2018 at 8:17
  • h1 is missing because of this: <?php if ($this->getIsHomePage()):?> So, only on homepage, h1 will be in your code, elsewhere not.
    – Anitr
    Commented Dec 4, 2018 at 12:28
0

You are checked this code from inspect elements. As per above code in header like

<?php echo $this->getChildHtml('topSearch') ?>

this is short code to call search form into header file. Actually the form coming from Theme/default/template/catalogsearch/form.mini.phtml file.

Above all short code coming form the particular file. So if you want to change into any section than just change into that files.

Thanks

0

Stupid thing but sorted it. Just added another div tag with class=logo four columns alpha and it ok now on all pages. Stupid mistake.

Maybe someone will have this must say very odd problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.