删除“由狂欢提供动力”页脚
我希望删除“由狂欢提供动力”页脚。有谁知道 这是在哪里?
另外,添加新分类法时如何覆盖“Shop By”?
谢谢
I'm looking to remove the "powered by spree" footer. does anyone know
where this is located?
also, how is the "Shop By" overridden when adding a new taxonomy?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
免责声明:这些提示可能与最新版本的 Spree 中所写的不完全一样。我最近没有和 Spree 合作过。
对于 Spree 1.0 版,您可以覆盖 app/views/spree/layouts/spree_application.html.erb。我认为当前版本中的路径与以前(1.0 之前)的版本略有不同。
作为一个更干净的选项,您可以使用 Deface 删除页脚中的“Powered by Spree”语句,如下所示:
如果您想替换它,您可以执行以下操作:
或者甚至更漂亮:
只需将上面的语句放入 rb文件并将其放置在 app/overrides 目录中。我认为将其放入配置/初始化程序中也可以。
PS Deface 已包含在 Spree 中,开箱即可使用。
Disclaimer: These tips may not work exactly as written in latest versions of Spree. I have not worked with Spree recently.
For Spree version 1.0, you can override app/views/spree/layouts/spree_application.html.erb. I think the path is slightly different in the current version from previous (pre- 1.0) versions.
As a cleaner option, you can use Deface to remove the "Powered by Spree" statement in the footer like so:
If you want to replace it instead, you can do something like:
Or even niftier:
Just put the statement above into an rb file and place it in the app/overrides directory. I think putting it into config/initializers would work too.
P.S. Deface is included in Spree out of the box.
这更新了 Binary 和 yuri 对 Spree v1.3 的答案,
页脚已移至部分
app/views/spree/shared/_footer.html.erb
中,以便覆盖它使用 Deface,您可以使用以下两种方法之一:
Deface::Override - 这是传统方法(根据 yuri 的答案)
因此要使用 Deface::Override,请创建一个文件
app/overrides/ remove_footer.rb
包含:OR
要使用 Deface DSL,请创建一个文件
app/overrides/spree/shared/footer/remove_footer.deface
,其中包含:请参阅 https://github.com/spree/deface 了解更多信息,很好。
This updates both Binary and yuri's answers for Spree v1.3
the footer has moved into the partial
app/views/spree/shared/_footer.html.erb
so to override it using Deface you can either of these two methods:
Deface::Override - this is the traditional method (as per yuri's answer)
the Deface DSL - .deface files (as per Binary's answer)
So to use Deface::Override, create a file
app/overrides/remove_footer.rb
containing:OR
to use the Deface DSL, create a file
app/overrides/spree/shared/footer/remove_footer.deface
containing:see the documentation at https://github.com/spree/deface for more information, it is good.
Yuri 的回答很好,但我更喜欢 Deface DSL 语法。对于 Spree 1.0 或更高版本,请在
app/overrides/spree/layouts/spree_application/
目录中创建一个名为remove_powered_by.deface
的文件,并添加以下内容:就是这样。
您可以在我公司的 Spree 商店代码中看到大量覆盖示例:
https://github.com/binaryphile/spree_dibs_1.3
Yuri's answer is fine but I like the Deface DSL syntax better. For Spree 1.0 or above, create a file called
remove_powered_by.deface
in the directoryapp/overrides/spree/layouts/spree_application/
and add the following contents:That's it.
You can see numerous examples of overrides in my company's Spree store code at
https://github.com/binaryphile/spree_dibs_1.3