README.md in spree_taxon_group-3.0.0.beta vs README.md in spree_taxon_group-3.1.0.beta
- old
+ new
@@ -1,33 +1,45 @@
# Spree Taxon Group
-Easily create and manage groups of taxons, irrespective of their parent or children taxons/taxonomies.
+Easily create and manage groups of taxons, irrespective of their parent or children taxons/taxonomies and control the position of taxons in their taxon 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`:
```html
<nav id="featured-categories" class="sidebar-item" data-hook>
- <% featured = Spree::TaxonGroup.find_by_name('featured') %>
+ <% 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`:
+
+```html
+<% 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`:
```ruby
-gem 'spree_taxon_group', github: 'whelton/spree_taxon_group', branch: 'master'
+gem 'spree_taxon_group', '~> 3.1', '>= 3.1.0.beta'
```
Run:
```sh