2

我正在尝试自定义我的狂欢应用程序:我覆盖导航栏菜单,如下所示:

Deface::Override.new(:virtual_path =>"spree/shared/_nav_bar",
                     :name => "main_menu",
                     :replace =>"nav#top-nav-bar",
                     :text => '<nav  class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div id="logo"><%= logo %></div>
    </div>
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right" data-hook>


    <li  id="search-bar" data-hook>
      <%= render :partial => "spree/shared/search" %>
    </li>
      </ul>
    </div>
    <!-- /.navbar-collapse -->
  </div>
  <!-- /.container -->
</nav>')

我得到了引导菜单设计,仍然有搜索表单,但设计注销,我的帐户链接消失了。我怎么能再次显示设计链接?

4

1 回答 1

1

如果有人需要,我找到了解决方案。我添加了另一个覆盖文件:

Deface::Override.new(:virtual_path => "spree/shared/_nav_bar",
                     :name => "auth_shared_login_bar",
                     :insert_before => "li#search-bar",
                     :partial => "spree/custom/custom_login_bar",
                     :disabled => false, 
                     :sequence => {:after => "auth_shared_login_bar"}
于 2015-02-27T09:17:17.487 回答