Domanda

Attualmente sto cercando di spostare la ricerca rapida di seguito il mio messaggio di benvenuto in tutte le pagine. Sono andato al mio tema / template / page / html / header.phtml e si è trasferito l'accoglienza-msg di sopra del 'TopSearch', ma non cambia nulla. Ho guardato tema / layout / page.xml , ma io non riesco a capire se c'è qualcosa che posso cambiare lì per farlo funzionare. Sono nuovo di PHP e XML in modo che qualsiasi aiuto sarebbe apprezzato.

Ecco il mio 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>

E il mio 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') ?>

Qualsiasi aiuto sarebbe molto apprezzato.

È stato utile?

Soluzione

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

Altri suggerimenti

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.

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top