magento我如何为特定模板创建特定主页 [英] magento how do i create specific home page for specific templates

查看:81
本文介绍了magento我如何为特定模板创建特定主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有一个很好的设计,我突然意识到我的设计在Internet Explorer 7和Internet Explorer 8中无法很好地呈现,我尝试了所有可能的方法,但是我仍然无法修复它,而且我不喜欢它在这些视图中的显示方式浏览器,所以我决定先添加MSIE 7.0,然后再添加defaul的值,以在设计配置栏上添加例外,并使用Internet Explorer 7进行了测试,效果很好,但我的问题是我的自定义主题包含一些大图像,文本和其他材料与css很好地对齐,但是一旦我将主题更改为默认主题,并且看不到那些css,它们也会以任何方式显示,这对我来说真的很痛苦,我现在要做的就是找到一种方法来制作默认主题加载不同的cms页面,而不是我的主要主题的常规主页.我不知道我是否可以做到,但是我需要一些帮助或指导.

I have a good design on my website and i suddenly realized my design does not render pretty well in internet explorer 7 and 8, i tried all that i can but i still cannot fix it and i dont like how its displaying in those browsers so i decided to add exception on the design configuration coumn by adding MSIE 7.0 and then value of defaul, tested with internet explorer 7 and it works well but my problem is that my custom theme has some large images and texts and other materials that were aligned nicely with css but once i changed the theme to default and it does not see those css, they also just display anyhow and its really a pain for me, all that i need to do now is find a way to make the default theme load with a different cms page instead of the normal homepage for my main theme. i dont know if i can do that but i need some little help or guide to go about it.

我遵循了您的指南并创建了文件,现在我可以在设计字段下看到welspot模板.

I followed your guide and have created the files and now i can see the welspot template under the design field.

现在我仍然需要使用旧的主页(我已经安装了带有hellowired主题的主页),现在我想将magento默认主题复制到我的程序包中并对其进行编辑,但是我需要找到一种方法来删除所有静态内容我通过布局文件创建的图块,因为我不会在默认主题中使用这些图块,即使可能的话,也可以通过xml添加不同的图像,因此我将使用两个具有相同主页的主题,但基于所使用主题的动态内容.

Now i need to still use the old homepage (the one i have installed with the hellowired theme), i want to copy magento default theme into my package now and edit it but i need to find a way to remove all the static blocks i created through maybe a layout file as i wont use those blocks in the default theme and even if possible add different images through xml so i would be using two themes with the same homepage but dynamic content based on the theme being used.

推荐答案

当然,您可以将创建的任何内容都设置为默认主页,但是您应该做一些事情.

Sure, you can set default home page whatever you create but you should do some things.

首先,创建 config.xml

<!-- path: app/code/local/Welspot/Page/etc/config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Welspot_Page>
    <version>0.1.0</version>
    </Welspot_Page>
</modules>
<global>
    <page>
    <layouts>
        <welspot_one_column_cms module="page" translate="label">
        <label>Welspot One Column</label>
        <template>page/welspot_one_column.phtml</template>
        <layout_handle>welspot_one_column_cms</layout_handle>
        </welspot_one_column_cms>
    </layouts>
    </page>
</global>
</config>  

第二,创建 Welspot_Page.xml

<!-- path : /app/etc/modules -->
<?xml version="1.0"?>
<config>
<modules>
    <Welspot_Page>
    <active>true</active>
    <codePool>local</codePool>
    </Welspot_Page>
</modules>
 </config>

第三,创建 welspot_one_column.phtml

<!-- path : /app/design/frontend/[your_package]/[your_theme]/template/page -->
<div>Hello World</div>

您可能会猜到,应该自定义welspot_one_column.phtml文件.

As you might guess, you should customize welspot_one_column.phtml file.

最后,转到Admin > CMS > Pages > Home Page > Design Tab选择新创建的模板(Welspot One Column).

Finally, go to Admin > CMS > Pages > Home Page > Design Tab select your newly created template (Welspot One Column).

这篇关于magento我如何为特定模板创建特定主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆