1

I am currently trying to move the quick search below my welcome message on all pages. I've gone to my theme/template/page/html/header.phtml and moved the welcome-msg above the 'topSearch', but it is not changing anything. I've looked at theme/layout/page.xml but I can't figure out if there's anything that I can change there to make it work. I'm new to PHP and XML so any help would be appreciated.

Here is my page.xml

        <block type="page/html_header" name="header" as="header">
            <block type="page/template_links" name="top.links" as="topLinks"/>
            <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
            <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                <label>Navigation Bar</label>
                <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
            </block>
            <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                <label>Page Header</label>
                <action method="setElementClass"><value>top-container</value></action>
            </block>
        </block>

And my header.phtml

<div class="header-container">
    <div class="header">
        <?php if ($this->getIsHomePage()):?>
        <h1 class="logo"><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">
            <p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>
            <?php echo $this->getChildHtml('topSearch') ?>
            <?php echo $this->getChildHtml('topLinks') ?>
            <?php echo $this->getChildHtml('store_language') ?>

        </div>
        <div id="phone_number">1(888)641-7988</div>
        <?php echo $this->getChildHtml('topContainer'); ?>
    </div>
</div>
<?php echo $this->getChildHtml('topMenu') ?>

Any help would be greatly appreciated.

1

Please correct your css, .header .form-search this css class is used for form search style and position:absolute is used in this class, so remove this and form search is moved below your welcome message

1

Instead of

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

use this

<?php $this->getLayout()->getBlock('top.search')->toHtml(); ?>

This way you can call your search anywhere in your .phtml file.

0

I think you should look at your CSS. If position: absolute is used, moving elements in html, does not help.

  • @JonathanUllberg Comments are not meant for saying thanks. For this we have up-vote ;) – ruuter Apr 18 '13 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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