I have created phtml file,


 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

// @codingStandardsIgnoreFile
/** @var \Magento\Contact\Block\ContactForm $block */
  <div class="form-group">
    <label for="Full Name">Full Name:</label>
    <input type="text" class="form-control" id="name">

  <div class="form-group">
    <label for="company name">Company Name:</label>
    <input type="text" class="form-control" id="companyname">

<div class="form-group">
    <label for="email id">Email Id:</label>
    <input type="text" class="form-control" id="emailid">

<div class="form-group">
    <label for="contact number">Contact Number:</label>
    <input type="text" class="form-control" id="contactnumber">

<div class="form-group">
    <label for="product name">Product Name:</label>
    <input type="text" class="form-control" id="productname">

<div class="form-group">

  <label for="comment">Comment:</label>
  <textarea class="form-control" rows="5" id="comment"></textarea>
  <button type="submit" class="btn btn-default">Submit</button>

and call this file in a static block in the backend

<p>{{store url="inquiry-page"}}</p>
{{block class="Magento\Framework\View\Element\Template" template="porto/Magento_Contact/inquiry.phtml"}}

but only <p>{{store url="inquiry-page"}}</p> is working. Phtml block in not calling up

3 Answers 3


Try this piece of code in your static block.

{{block class="Magento\Contact\Block\ContactForm" name="inquiry.form"  template="Magento_Contact::inquiry.phtml"}}

For Example You can use Magento\Framework\View\Element\Template class to call phtml files

{{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}

To call advanced form use Magento\CatalogSearch\Block\Advanced\Form block class.

{{block class="Magento\CatalogSearch\Block\Advanced\Form" name="block_name" template="Magento_CatalogSearch::advanced/form.phtml"}}

You can call phtml file on CMS Static Block like below

{{block class="Block Name" template="Vendor_Module::phtml_file_name"}}

So, in your case it might be

{{block class="Magento\Framework\View\Element\Template" template="Magento_Contact::inquiry.phtml"}}

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.