No commit activity in last 3 years
No release in over 3 years
Extension to create and manage groups of taxons
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.1.0.beta
 Project Readme

Spree Taxon Group

Easily create and manage groups of taxons, irrespective of their parent or children taxons/taxonomies and control the position/order of taxons in their groups. Useful if you need flexible taxon usage, for example a group of taxons for featured categories from different parent taxon/taxonomies.


Usage

If you want a taxon tree, similar to taxons_tree in the default spree sidebar. You can use the helper taxon_group_tree:

<nav id="featured-categories" class="sidebar-item" data-hook>
  <% featured = Spree::TaxonGroup.find_by_key('featured') %>
  <% cache [I18n.locale, featured] do %>
    <h4 class='taxon-group-root'><%= Spree.t(:shop_by_taxon_group, :taxon_group => featured.name) %></h4>
    <%= taxon_group_tree(featured, @taxon) %>
  <% end %>
</nav>

or for more control, without taxon_group_tree:

<% navigation_taxon_upcase_group = Spree::TaxonGroup.find_by_key('navigation') %>
<% cache [I18n.locale, navigation_taxon_upcase_group] do %>
  <%= navigation_taxon_upcase_group.taxons.map do |taxon|
        '<li class="hidden-lg hidden-md">' + link_to(taxon.name.upcase, seo_url(taxon)) + '</li>'
      end.join("\n").html_safe
  %>
<% end %>

Basic Installation

Add to your Gemfile:

gem 'spree_taxon_group', '3.1.0.beta'

Run:

bundle && bundle exec rails g spree_taxon_group:install

That's it!


Contributing

See corresponding guidelines and check out the issues.


Copyright (c) 2015 James Whelton and contributors, released under the New BSD License