2

I have a modal to show in every page, my modal was created in phtml file which using custom block file. i want to show this modal in every page of magento, is there a way to do this?

3

you can do this by following layout xml file.

app/code/Company/Module/view/frontend/layout/default.xml

the content would be like this:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        // reference a container to show your model
    </body>
</page>

NOTE: you can refer any core module's layout file for above content.

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.