10

I have extended LUMA theme and want to customize header.

I want to add static block before logo and want to move logo to center of page which is on left side.

Final result will be

[1] static block [2] logo (in center) [3] Search form (this is already on correct position).

Please advice how to achieve this.

10

You can do this by putting DIV over your logo and search box

Also create a "container" for your static block (inside this you can call your static block) in logo.phtml.

Now assign a class to each container and give them required width and float them accordingly .

So it will look like 1) Static block 2) Logo 3) Search

I hope someone else will get idea from here , as I am posting late on question .

10

you use referenceBlock logo

<referenceBlock name="logo">
        <block class="Magento\Cms\Block\Block" name="test_links">
          <arguments>
           <argument name="block_id" xsi:type="string">test_links</argument>
          </arguments>
        </block>
</referenceBlock>
  • Where to add this. I have also extended LAYOUT and this should be added in layout/default.xml (i think) – Jai Dec 8 '16 at 8:02
  • @Jai yes default will do that. – Fme Extensions Dec 8 '16 at 9:10
  • Added static block with "testblock" identifier in admin. Added above lines replacing testblock in default.xml. Deployed, Upgraded, flushed but but didint work :( – Jai Dec 8 '16 at 9:29
  • did you add <body></body> tag – Fme Extensions Dec 8 '16 at 9:41
  • Yes .Here is all code of extended default.xml: <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="logo"> <block class="Magento\Cms\Block\Block" name="testblock"> <arguments> <argument name="testblock" xsi:type="string">testblock</argument> </arguments> </block> </referenceBlock> </body> </page> – Jai Dec 8 '16 at 9:50

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.