5

I'm trying to make different page where i need PHP. thats why i use a phtml file. I don't want to make any changes to the other Magento layouts so I just want to include the phtml file via the CMS.

I've made a phtml file in: mycustomtemplate/template/page/page.phtml

that file contains just 'test'.

then I've tried to call in the magento CMS->new page->content tab with:

{{block type="core/template" template="page/page.phtml"}}

but nothing shows up. Is there any way to do this? And how..

6

The syntax is correct, so the issue is theme misconfiguration or the "Test" output is being hidden in the browser. View source and confirm that the latter is not the case.

Try creating a copy of the file at frontend/base/default/template/page/page.phtml as this template location has to work - if the content appears, the issue is theme misconfiguration.

  • +1 The syntax is correct. It looks more like he's not set your theme and package properly – Ben Lessani - Sonassi Apr 27 '13 at 18:20
1

It depends on what version of Magento you're running if you're trying to place the file in the base template - make sure that you're not placing the file in the (now deprecated) default/default path:

Pre 1.4CE/1.8EE:

frontend/default/default/template/page/page.phtml

After 1.4CE/1.8EE:

frontend/base/default/template/page/page.phtml

Some extra reading on theme hierarchy from the Magento KB:

http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy#3.2

  • 1
    But please don't places files in the base template unless you're an extension developer. Put them in your own package/theme. – philwinkle Apr 28 '13 at 14:37
0

Your solution is correct (I've just tested it). Make sure you created your template file in the correct directory. It should be placed here:

app/design/frontend/[package]/[theme]/template/page/page.phtml

And flush Magento cache.

0

You are heading towards right direction. Cache refresh, already purposed, additionally, turn on the magento development mode to make sure your block has been added to the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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