我对 layout.html.erb 上与疯狂商业的 index.html.erb 相关的污损感到困惑
I get confuse about deface at layout.html.erb that which relate with index.html.erb of spree commerce
我通宵试了一个星期,想知道如何自定义 index.html.erb 但没有 luck.I 使用 spree v.3.0 rc4(bootstrap 版本),我想要一个图片显示在 index.html.erb
我的 scss 文件如下
#intro {
display: table;
width: 100%;
height: auto;
padding: 100px 0;
text-align: center;
color: $grayscale-light;
background: $grayscale-dark asset-url('intro-bg.jpg');
.intro-body {
display: table-cell;
vertical-align: middle;
.brand-heading {
font-size: 40px;
}
.intro-text {
font-size: 18px;
}
}
}
这是我在 index.html.erb
中的定制
<div class="intro-body">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">Shop name</h1>
<p class="intro-text"> Welcome to my shop.</p>
</div>
</div>
下面是我在 layout.html.erb
的污损之一
<!-- surround_contents'#body' -->
<div id="intro">
<%= render_original %>
</div>
我试过
surround_cotents , insert_before , insert _after
但是结果不是我想要的,比如当我在正文中 surround_contents 时,结果也会将我的图片替换为产品页面的背景。
此外,我尝试使用 insert_before 和之后的容器,但不仅有一个容器而且看起来图像没有像我希望的那样显示为全宽图像。
一头雾水,不知如何是好。
我认为完成所需任务的最简单方法是在本地覆盖索引模板,而不是尝试使其与污损一起使用。我通常会在我的本地视图目录中保存更改管理界面和覆盖前端模板的污损。
如果您从此文件复制代码:https://github.com/spree/spree/blob/3-0-stable/frontend/app/views/spree/home/index.html.erb,并将其粘贴到 app/views/spree/home/index。html.erb,您的本地更改将优先于 Spree 中的模板 gem.
我通宵试了一个星期,想知道如何自定义 index.html.erb 但没有 luck.I 使用 spree v.3.0 rc4(bootstrap 版本),我想要一个图片显示在 index.html.erb
我的 scss 文件如下
#intro {
display: table;
width: 100%;
height: auto;
padding: 100px 0;
text-align: center;
color: $grayscale-light;
background: $grayscale-dark asset-url('intro-bg.jpg');
.intro-body {
display: table-cell;
vertical-align: middle;
.brand-heading {
font-size: 40px;
}
.intro-text {
font-size: 18px;
}
}
}
这是我在 index.html.erb
中的定制<div class="intro-body">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">Shop name</h1>
<p class="intro-text"> Welcome to my shop.</p>
</div>
</div>
下面是我在 layout.html.erb
的污损之一<!-- surround_contents'#body' -->
<div id="intro">
<%= render_original %>
</div>
我试过
surround_cotents , insert_before , insert _after
但是结果不是我想要的,比如当我在正文中 surround_contents 时,结果也会将我的图片替换为产品页面的背景。
此外,我尝试使用 insert_before 和之后的容器,但不仅有一个容器而且看起来图像没有像我希望的那样显示为全宽图像。
一头雾水,不知如何是好。
我认为完成所需任务的最简单方法是在本地覆盖索引模板,而不是尝试使其与污损一起使用。我通常会在我的本地视图目录中保存更改管理界面和覆盖前端模板的污损。
如果您从此文件复制代码:https://github.com/spree/spree/blob/3-0-stable/frontend/app/views/spree/home/index.html.erb,并将其粘贴到 app/views/spree/home/index。html.erb,您的本地更改将优先于 Spree 中的模板 gem.