Getting started with Spree/Products/Index

From the Directed Edge Developer Base
Jump to: navigation, search
<% unless edgy_recommended.empty? %>
  <h3 class="list-type"><%= edgy_message %></h3>
  <ul class="product-listing">
    <% edgy_recommended.each do |product| %>
      <li id="product_<%= product.id %>">
        <%= link_to small_image(product), product %>
        <%= link_to raw(product.name + " <span class='price selling'>#{product_price(product)}</span>"), product, :class => 'info' %>
      </li>
    <% end %>
  </ul>
  <h3 class="list-type">Our catalog:</h3>
<% end %>
<% content_for :sidebar do %>
  <% hook :homepage_sidebar_navigation do %>
    <% if "products" == @current_controller && @taxon %>
      <%= render "shared/filters" %>
    <% else %>
      <%= render "shared/taxonomies" %>
    <% end %>
  <% end %>
<% end %>
<% if params[:keywords] %>
  <% hook :search_results do %>
    <% if @products.empty? %>
      <%= t(:no_products_found) %>
    <% else %>
      <%= render "shared/products", :products => @products, :taxon => @taxon %>
    <% end %>
  <% end %>
<% else %>
  <% hook :homepage_products do %>
    <%= render "shared/products", :products => @products, :taxon => @taxon %>
  <% end %>
<% end %>