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?

1 Answer 1


you can do this by following layout xml file.


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">
        // reference a container to show your model

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 and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.