cancel
Showing results for 
Search instead for 
Did you mean: 

reuse a block in magento 2.4

reuse a block in magento 2.4

Hey,

 

I am digging into Magento for several weeks. Anyone knows how to reuse a block such logo block. I want to it display in the header and footer.

Thanks

1 REPLY 1

Re: reuse a block in magento 2.4

You would just call the block in the xml files

 

Reference the block

 

        <referenceContainer name="main.content">
            <block class="Amasty\Blog\Block\Content\Post\Details" name="blog_header_list" before="columns"
            template="Amasty_Blog::blog-header-list.phtml"/>
        </referenceContainer>
        <!-- custom override  -->