0

I am using Luma default theme in Magento 2 and I want to create a new phtml file and call it from CMS.

Can anyone tell me in which path i need to create my file and how to call it form CMS?

I trying to create in this path: C:\xampp2\htdocs\medipoint\vendor\magento\theme-frontend-luma\Special_Price\special_price.phtml

and call it in this way:

{{block class="Magento\Framework\View\Element\Template" name="myname" template="Magento_Theme::Special_price/special_price.phtml"}}

but it doesn't work.

6
  • is Magento_Theme your module name ?
    – Priyank
    Commented Oct 21, 2016 at 8:31
  • you have to first create your theme Commented Oct 21, 2016 at 8:40
  • i am new in magneto so i don't know. i am using default Luma theme Commented Oct 21, 2016 at 8:40
  • Have you create new theme? Commented Oct 21, 2016 at 8:40
  • no. actually i want only to create a single page in my current theme and use it in cms. is that possible? Commented Oct 21, 2016 at 8:42

1 Answer 1

2

Working Completely.

{{block class="Magento\Framework\View\Element\Template" name="myname" template="Magento_Theme::Special_price/special_price.phtml"}}

But file must be locate in correct path

app/design/frontend/YourTheme/YourThemePackage/Magento_Theme/templates/Special_price/special_price.phtml

If you are using Luma theme then file path :

magento2/vendor/magento/theme-frontend-luma/Magento_Theme/templates/Special_price/special_price.phtml
0

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.