Answer the question
In order to leave comments, you need to log in
How to download the template correctly?
Need to load and render page after template! The page loads but the template content is not displayed. (Magento Full Release - ver 1.9.2.4)
First I create in /app/design/frontend/
my directory news
in it newstheme
and in it /layout/vitaliydev_news.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<vitaliydevnews_index_index>
<reference name="content">
<block type="core/template" template="vitaliydev_news/index.phtml"/>
</reference>
</vitaliydevnews_index_index>
</layout>
/app/design/frontend/newstheme/template/vitaliydev_news/index.phtml
: <h1>Template ews/index.phtml</h1>
layout
:<layout>
<updates>
<vitaliydevnews>
<file>vitaliydev_news.xml</file>
</vitaliydevnews>
</updates>
</layout>
action
in the Controller:public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
Answer the question
In order to leave comments, you need to log in
This may be a simple typo, but the theme path is incorrect:
Check if you have the template enabled in the settings System - Configuration - General - Design (or System - Design)
Way # 2: Try loading the page template through the module.
The process of loading a page according to a template can be decomposed into several points:
1. Connection in the module settings (config.xml):
<config>
<global>
<!-- тут блоки, модели, хелперы -->
</global>
<frontend>
<routers>
<уникальный_нод>
<use>standard</use>
<args>
<module>Название_Модуля</module>
<frontName>ссылка_для_загрузки</frontName>
<!-- домен/язык_если_есть/ссылка_для_загрузки/контроллер-->
<!-- в вашем примере домен/vitaliydevnews/index, или просто домен/vitaliydevnews/-->
</args>
</уникальный_нод>
</routers>
<layout>
<updates>
<уникальный_нод>
<file>файл обновления макета в шаблоне.xml</file>
</уникальный_нод>
</updates>
</layout>
</frontend>
</config>
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
<!-- судя по всему у вас должно быть так: app/design/frontend/news/newstheme/layout/vitaliydev_news.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<уникальный_нод_index_index> <!-- использовался в настройках модуля config.xml-->
<reference name="root">
<action method="setTemplate"><template>vitaliydev_news/index.phtml</template></action>
<!-- путь к шаблону app/design/frontend/news/newstheme/template/vitaliydev_news/index.phtml -->
</reference>
</уникальный_нод_index_index>
</layout>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question