Magento-在主题After_Body_Start的所有页面上添加一些HTML [英] Magento - Add Some HTML on All Pages of my Theme After_Body_Start

查看:40
本文介绍了Magento-在主题After_Body_Start的所有页面上添加一些HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在页面的after_body_start部分中为主题的每个页面添加一些HTML.

I am trying to add a bit of HTML to every page of my theme in the after_body_start section of the page.

我在此处创建了一个模板,其中包含以下内容app/design/frontend/custompackage/genesis/template/page/custom/siteCanvasAdjustment.phtml:

I created a template here with the following contents app/design/frontend/custompackage/genesis/template/page/custom/siteCanvasAdjustment.phtml:

<p>Hello World</p>

在位于以下位置的我的local.xml文件中:app/design/frontend/custompackage/genesis/local.xml,我添加了以下代码行:

In my local.xml file located here: app/design/frontend/custompackage/genesis/local.xml, I have added the following line of code:

<layout version="0.1.0">
<default>    
<reference name="after_body_start">
<bock type="core/template" name="siteCanvasAdjustment" as="siteCanvasAdjustment" template="page/custom/siteCanvasAdjustment.phtml" output="toHtml" before="-" />
</reference>
</default>

但是,"Hello World"仍未在页面上呈现.我验证了主题已成功安装.我对head.phtml文件进行的更改并放入主题工作中.另外,诸如local.xml中的以下更改也可以正常工作:

However, "Hello World" is still not rendering on the page. I verified that the theme is successfully installed. Changes that I have made to the head.phtml file and placed in my theme work. Also, changes such as the following in local.xml work fine:

<reference name="head">
    <action method="removeItem"><type>skin_js</type><name>js/slideshow.js</name></action>
</reference>

知道我在做什么错吗?我是Magento的新手,并阅读了所有教程,但显然缺少一些内容.

Any idea what I am doing wrong? I am new to Magento and read up on all the tutorials but am clearly missing something.

推荐答案

您的local.xml应该位于布局文件夹下,而不是直接在主题文件夹下,而且您的代码块有拼写错误,显示为博克而不是代码块.

Your local.xml should be under layout folder not directly under theme folder, also your block has spelling mistake it says bock instead of block.

希望有帮助

NB不要忘了清除缓存.

N.B Don't forget to clear cache.

欢呼S

这篇关于Magento-在主题After_Body_Start的所有页面上添加一些HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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