magento 模板(主题)制作准备
2014-05-13 15:59
316 查看
1.下载安装最新版的magento(带演示数据)
2.下一个中文的包(我英文比较差,安装上去,要是想英文的在后台中也是很容易切换的)
3.在后台关闭缓存和开启debug 模式
a.打开调试模式:直接把index.php 中的
这两条语句变为有效
4.写一个用于测试的模块test(主要测试一些关键的输出)
a.新建文件夹 app\code\local\MyTest\Test\Block
app\code\local\MyTest\Test\controllers
app\code\local\MyTest\Test\etc
app\code\local\MyTest\Test\Model
b.新建一个配置文件内app\code\local\MyTest\Test\etc\config.xml容如下
c.创建一个配置文件app\etc\modules\MyTest_Test.xml内容如下:
这时候可以在后台system->configuration->advanced 中看到MyTest_Test模块
d.配置路由,编辑上面的config.xml 加上如下代码
e.新建一个控制器文件app\code\local\MyTest\Test\controllers\IndexController.php内容如下
此时访问magento\index.php\test 可以看到页面输出test
f.新建一个布局文件app\design\frontend\base\default\layout\local.xml 内容如下
g.新建一个phtml文件app\design\frontend\base\default\template\test\test.phtml 内容如下
h.修改IndexController.php内容如下
访问此时访问magento\index.php\test 可以看到页面输出mmmmmm到此就可以了,等到以后可以在local.xml加bolck 然后看各个phtml文件的输出
5.下载安装一个layoutview模块
到此准备工作已经完成
2.下一个中文的包(我英文比较差,安装上去,要是想英文的在后台中也是很容易切换的)
3.在后台关闭缓存和开启debug 模式
a.打开调试模式:直接把index.php 中的
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) { Mage::setIsDeveloperMode(true); } #ini_set('display_errors', 1);
这两条语句变为有效
4.写一个用于测试的模块test(主要测试一些关键的输出)
a.新建文件夹 app\code\local\MyTest\Test\Block
app\code\local\MyTest\Test\controllers
app\code\local\MyTest\Test\etc
app\code\local\MyTest\Test\Model
b.新建一个配置文件内app\code\local\MyTest\Test\etc\config.xml容如下
<config> <modules> <MyTest_Test> <version>0.1.0</version> </MyTest_Test> </modules> </config>
c.创建一个配置文件app\etc\modules\MyTest_Test.xml内容如下:
<config> <modules> <MyTest_Test> <active>true</active> <codePool>local</codePool> </MyTest_Test> </modules> </config>
这时候可以在后台system->configuration->advanced 中看到MyTest_Test模块
d.配置路由,编辑上面的config.xml 加上如下代码
<config> ..... <frontend> <routers> <mytest> <use>standard</use> <args> <module>MyTest_Test</module> <frontName>test</frontName> </args> </mytest> </routers> </frontend>
............
e.新建一个控制器文件app\code\local\MyTest\Test\controllers\IndexController.php内容如下
<?php /* * Created on 2014-5-13 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class MyTest_Test_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { echo "test"; } } ?>
此时访问magento\index.php\test 可以看到页面输出test
f.新建一个布局文件app\design\frontend\base\default\layout\local.xml 内容如下
<layout version="0.1.0"> <test_index_index> <reference name="root"> <block type="page/html" name="root" output="toHtml" template="test/test.phtml"></block> </reference> </test_index_index> </layout>
g.新建一个phtml文件app\design\frontend\base\default\template\test\test.phtml 内容如下
mmmmmmmmmmmmmm
h.修改IndexController.php内容如下
<?php /* * Created on 2014-5-13 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class MyTest_Test_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { //echo "test"; $this->loadLayout(); $this->renderLayout(); } } ?>
访问此时访问magento\index.php\test 可以看到页面输出mmmmmm到此就可以了,等到以后可以在local.xml加bolck 然后看各个phtml文件的输出
5.下载安装一个layoutview模块
到此准备工作已经完成
相关文章推荐
- 安装magento主题模板
- Magento模板制作详细教程
- WordPress主题制作全过程(一):基础准备
- Drupal Joomla Magento WordPress Ecshop CMS教程大全 模板 主题 教程(转)
- 推荐magento模板制作中文视频 -- 钥匙出品,值得信赖
- Magento邮件模板制作
- WP主题模板制作修改教程
- WordPress主题制作(6)-关于页面模板
- magento模板 -- 在magento中如何才能获取当前的主题的URL
- Magento模板制作入门,超级棒哦~~
- WordPress主题制作全过程(一):基础准备
- magento模板制作教程(一)
- wordpress主题制作教程(十):制作文章单页模板single.php
- 动易模板——制作前的准备工作
- WordPress主题制作全过程(三):HTML静态模板制作
- wordpress主题制作常用基本的模板及说明
- Drupal8系列(四):主题制作的前期准备-Ubuntu 14.04 LTS
- WordPress主题制作全过程(三):HTML静态模板制作
- emlog主题模板制作教程
- magento二次开发、模板制作-说明文档