han*_*Dev 2 ruby-on-rails e-commerce spree
我正在寻找删除"由狂欢驱动"页脚.有谁知道它在哪里?
另外,在添加新分类法时,"Shop By"如何被覆盖?
谢谢
免责声明:这些提示可能与最新版本的Spree中写的完全不同.我最近没有和Spree合作过.
对于Spree 1.0版,您可以覆盖app/views/spree/layouts/spree_application.html.erb.我认为当前版本与之前(1.0之前版本)版本的路径略有不同.
作为一个更干净的选项,您可以使用Deface删除页脚中的"Powered by Spree"语句,如下所示:
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
:name => "footer-left",
:remove => "#footer-left")
Run Code Online (Sandbox Code Playgroud)
如果您想替换它,您可以执行以下操作:
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
:name => "footer-left",
:replace_contents => "#footer-left",
:text => "My Left Footer Text")
Run Code Online (Sandbox Code Playgroud)
甚至更轻松:
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
:name => "footer-left",
:replace_contents => "#footer-left") do
'<div id="footer-left" class="columns alpha eight" data-hook>
<p><%= t(:powered_by) %> <%= link_to "YuriTek", "http://yuritek.com" %></p>
</div>'
end
Run Code Online (Sandbox Code Playgroud)
只需将上面的语句放入rb文件并将其放在app/overrides目录中即可.我认为将它放入配置/初始化器也会起作用.
PS Deface包含在Spree中,开箱即用.
| 归档时间: |
|
| 查看次数: |
2951 次 |
| 最近记录: |