删除“由狂欢提供动力”页脚

发布于 2024-10-11 19:49:18 字数 80 浏览 6 评论 0原文

我希望删除“由狂欢提供动力”页脚。有谁知道 这是在哪里?

另外,添加新分类法时如何覆盖“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花想c 2024-10-18 19:49:18

免责声明:这些提示可能与最新版本的 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")

如果您想替换它,您可以执行以下操作:

Deface::Override.new(:virtual_path => "spree/layouts/spree_application", 
                 :name => "footer-left",
                 :replace_contents => "#footer-left", 
                 :text => "My Left Footer Text")

或者甚至更漂亮:

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

只需将上面的语句放入 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:

Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
                 :name => "footer-left",
                 :remove => "#footer-left")

If you want to replace it instead, you can do something like:

Deface::Override.new(:virtual_path => "spree/layouts/spree_application", 
                 :name => "footer-left",
                 :replace_contents => "#footer-left", 
                 :text => "My Left Footer Text")

Or even niftier:

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

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.

上课铃就是安魂曲 2024-10-18 19:49:18

这更新了 Binary 和 yuri 对 Spree v1.3 的答案,

页脚已移至部分 app/views/spree/shared/_footer.html.erb 中,

以便覆盖它使用 Deface,您可以使用以下两种方法之一:

  1. Deface::Override - 这是传统方法(根据 yuri 的答案)

  2. < p>Deface DSL - .deface 文件(根据 Binary 的答案)

因此要使用 Deface::Override,请创建一个文件 app/overrides/ remove_footer.rb 包含:

Deface::Override.new(:virtual_path => 'spree/shared/_footer',
         :name => 'remove_footer',
         :remove => '#footer[data-hook]'
        )

OR
要使用 Deface DSL,请创建一个文件 app/overrides/spree/shared/footer/remove_footer.deface ,其中包含:

remove '#footer[data-hook]'

请参阅 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:

  1. Deface::Override - this is the traditional method (as per yuri's answer)

  2. the Deface DSL - .deface files (as per Binary's answer)

So to use Deface::Override, create a file app/overrides/remove_footer.rb containing:

Deface::Override.new(:virtual_path => 'spree/shared/_footer',
         :name => 'remove_footer',
         :remove => '#footer[data-hook]'
        )

OR
to use the Deface DSL, create a file app/overrides/spree/shared/footer/remove_footer.deface containing:

remove '#footer[data-hook]'

see the documentation at https://github.com/spree/deface for more information, it is good.

追我者格杀勿论 2024-10-18 19:49:18

Yuri 的回答很好,但我更喜欢 Deface DSL 语法。对于 Spree 1.0 或更高版本,请在 app/overrides/spree/layouts/spree_application/ 目录中创建一个名为 remove_powered_by.deface 的文件,并添加以下内容:

<!--
  remove '#footer-left > p:first-child'
-->

就是这样。

您可以在我公司的 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 directory app/overrides/spree/layouts/spree_application/ and add the following contents:

<!--
  remove '#footer-left > p:first-child'
-->

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文