M
M
Maybe_V2016-07-10 09:59:28
PHP
Maybe_V, 2016-07-10 09:59:28

How to set up a Magento template correctly?

You need to implement your own templateand layout(Magento Full Release - ver 1.9.2.4).
I create in design/frontendmy directory where the theme will be new and in it a folder defaul.
The template path looks like this

design/frontend/new/default/template/dev_news/index.phtml
:
<h1>Template news/index.phtml</h1>
Path to leyout - design/frontend/new/default/layout/dev_news.xml:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <vitaliydevnews_index_index>
        <reference name="content">
            <block type="core/template" template="dev_news/index.phtml"/>
        </reference>
    </vitaliydevnews_index_index>
</layout>

But magento does not see it and displays the result on the screen, but not behind my template.
When I did this in the controller:
public function indexAction()
    {
       $this->loadLayout();
        $layoutHandles = $this->getLayout()->getUpdate()->getHandles();
        echo '<pre>' . print_r($layoutHandles, true) . '</pre>';
        $this->renderLayout();
    }

Gave the result:
Array
(
    [0] => default
    [1] => STORE_default
    [2] => THEME_frontend_rwd_default
    [3] => vitaliydevnews_index_index
    [4] => customer_logged_out
)

I paid attention to [2] => THEME_frontend_rwd_default , then I threw my template and layout into fronted/rwd/default respectively layout and template.
But I need it to be like I did!
What should (can) be done so that it finds my topic?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CodeKeeper, 2016-07-14
@CodeKeeper

Well, for starters, in order for the system to start using a new theme, you need the package and theme (optional, uses default by default) to be installed in the admin panel.
Second. dev_news.xml file is not processed by anything. If you need to customize the theme, then a local.xml file is created in the layout folder and everything is edited there, or the corresponding layout files are copied from the theme base and they are edited.
info2.magento.com/rs/magentosoftware/images/magent...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question