我需要在我的 Magento 网站 tamween.biz 的顶部横幅中添加一个阴影效果 png 图片,我可以在我的本地服务器上使用 firebug 通过在正确的编码区域添加一个新类来执行此操作,并且我已经在bootstrap.css 文件。
这次测试很成功,问题是我不知道在服务器中哪里可以找到真正的HTML文件来编辑这些更改?
root/app/design/frontend/<package>/<theme>/template/page/html/header.phtml
System => Configuration => General => Design => Header => Logo Image Src
root/skin/frontend/<package>/<theme>/css
如果您已经创建了自定义主题,请转到
root/app/design/frontend//yourtheme/template/page/html/header.phtml
如果没有,那就去
root/app/design/frontend/base/default/template/page/html/header.phtml
和 n 搜索
<img src="<?php echo $this->getLogoSrc() ?>">
这是输出图像的代码。您可以向其中添加 css 类。
在 magento 中转到系统 - > 配置并设置模板提示是的。
这样,您将看到静态块来自的每个模板部分。
Magento HTML 页面由块组成,每个块都有一个模板文件。要找出每个块模板文件的位置,您可以将一些代码添加到核心并在完成后将其删除。
打开app/code/core/Mage/Core/Block/Template.php:241
。这应该在方法中fetchView
,然后将具有include
代码的行编辑为以下
if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) {
echo "<!-- template hint start\n";
echo $includeFilePath."\n";
echo get_class($this)."\n";
echo "-->";
include $includeFilePath;
echo "<!-- template hint end\n";
echo $includeFilePath."\n";
echo get_class($this)."\n";
echo "-->";
} else {
这将添加 HTML 注释,告诉您模板文件路径以及$this
在该上下文中的含义。
(参考)