cancel
Showing results for 
Search instead for 
Did you mean: 

Modify footer in theme

Modify footer in theme

I have created a new theme.

 

In admin panel I have:

  • Content->Blocks->Add New Block, craeted a new block with id "foo_block", selected stores and written some content.

Under app/design/frontend/xxx/yyy/Magneto_Theme/templates/html/footer.phtml

I have added:

 

<div class="footer-container">
<div class="footer">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('foo_block')->toHtml() ?>
<p>This is some text.</p>
</div></div>

 

 

 

Nothing happens. Why doesnt at least "This is some text" appear?

 

Where is the order of the blocks stored in the footer and how do I add a block at the beginning of the footer?

I would like to just add some static HTML to the footer.

 

All of the online help presupposes that one knows everything about blocks or at least everything about how to do things in Magento 1 (I am starting from Magento 2). I mean, I get what blocks are, but no matter how much threads I read about them, I do not understand in what files  to write the php code for them and how to link this file so that it actually shows up in the browser. I have tried like a million things.

 

Please help! Smiley Sad

1 REPLY

Re: Modify footer in theme

OK, so I have actually managed to add something to the footer by adding this to

/*/*/Magento_Theme/layout/default.xml:

 

...
		<referenceBlock name="footer_links">
			
            <block class="Magento\Cms\Block\Block" name="foo_block">
                <arguments>
                    <argument name="block_id" xsi:type="string">foo_block</argument>
                </arguments>
            </block>

...

So the block foo shows after the "advanced search" link. How do I move it before the links (before Privacy and cookie policy).

I am actually trying to make the header consisting of two columns. but I guess I could add some html before and some html after to achieve this...