0

I tried overnight for a week to findout how to customize index.html.erb but no luck.I use spree v.3.0 rc4 (bootstrap version) , I'd like to have an image show on index.html.erb

My scss file like below

#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;
    }
  }
}

Here is my customize within 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>

And here below is one of my deface at layout.html.erb

<!-- surround_contents'#body' -->
    <div id="intro">
  <%= render_original %>
</div>

I tried with

surround_cotents , insert_before , insert _after

But the result is not what I want such as when I surround_contents at body, the result will replace my image as background at products page too.

Also, I tried with insert_before and after for container but there are not only one container and look seem the image is not show as full width image as I wish.

I got confused and don't know how to go on.

4

1 回答 1

0

I think the easiest way for you to accomplish what you need will to override the index template locally rather than try and make it work with deface. I usually save deface for making changes to the admin interface and override front-end templates in my local views directory.

If you copy the code from this file: https://github.com/spree/spree/blob/3-0-stable/frontend/app/views/spree/home/index.html.erb, and paste it in app/views/spree/home/index.html.erb, your local changes will take precedence over the templates in the Spree gem.

于 2015-03-29T15:56:17.103 回答