3

This question already has an answer here:

I have created extension in Magento 2 and i want to call index.phtml file from static block (from admin panel). Module structure

Ashore>Faq>Block>Faq>Index.phtml

Ashore>Faq>View>frontend>Templates>faq>index.phtml

how can i call?

marked as duplicate by Khoa TruongDinh, Manthan Dave, Manashvi Birla, Murtuza Zabuawala, Siarhey Uchukhlebau Jun 27 '17 at 9:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6
{{block class="<vendor_name>\<module_name>\Block\<module_name>" name="<your_block_name>" template="<vendor_name>_<module_name>::<template_directory>/filename.phtml"}}

In your case it is look like

{{block class="Ashore\Faq\Block\Faq\Index" name="Faq" template="Ashore_Faq::faq/index.phtml"}}
1

You can Use this to call template file in static block

{{block class="Block Name" template="PackageName_ ModuleName::phtml file name"}}
1

You can call your .phtml file in CMS page like below

{{block class="Ashore\Faq\Block\Faq\Index" name="faq" template="Ashore_Faq::faq/index.phtml"}}

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