Magento 2 – How to Call a Static Block in the Footer

footermagento2PHPphtmlstatic-block

I created a static block in backend of my magento and now i would like to recall the created block in the footer, near to the footer link .

In what phtml files I retrieve it?

Thanks.

P.S. Where is the file of footer links for change the link and name?

Best Answer

From templates you can simply call static block by
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?>
Links in footer generate by layout in module Magento_Theme

<referenceContainer name="footer-container">
        <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Framework\View\Element\Html\Links" name="footer_links">
                <arguments>
                    <argument name="css_class" xsi:type="string">footer links</argument>
                </arguments>
            </block>
            <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/>
            <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" />
        </container>
    </referenceContainer>