I have custom module by calling the controller in url address bar. How to display the custom module in home page. Should i create block?. How to call below or above the content.
1 Answer
you can call your custom module's phtml file into homepage' cms page
add below code into Content -> Pages -> home(page) -> in content section
{{block class="Namespace\Modulename\Block\Slideshow" template="Namespace_Modulename::bannerslider.phtml"}}
try below way if you don't have block
{{ block type="core/template" template="YourtemplateFileLocation.phtml"}} //like Namespace_Modulename::bannerslider.phtml
OR
{{block class="Magento\Framework\View\Element\Template" template="[VendorName]_[ModuleName]::[YourTemplateFileLocation].phtml"}}
[EDIT]
call any phtml file into cms block
{{block class="\\Block\" name="" template="_::/filename.phtml"}}
In your case it is look like
{{block class="Ashore\Faq\Block\Faq\Index" name="Faq" template="Ashore_Faq::faq/index.phtml"}}
-
-
if you want to display your phtml file just after hotsellers, hotsellers is existed into block just go to Content -> Blocks -> Find Home Page Block add above anyone method at last there you will get o/p– HiteshOct 25, 2018 at 11:59