Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed collections tag for shop (now accessible as intended)

  • Loading branch information...
commit 120775be57b44f99691901344a18edd466f1ab88 1 parent 874d50f
@danielw danielw authored
View
8 server/app/drops/collection_collection_drop.rb
@@ -6,4 +6,12 @@ def before_method(value)
collection['products_count'] ||= collection['products'].size
collection
end
+
+ def each
+ Database.find(:all, :collections).each { |c| yield c }
+ end
+
+ def size
+ Database.find(:all, :collections).size
+ end
end
View
4 server/app/servlets/vision_servlet.rb
@@ -56,9 +56,9 @@ def standard_templates
['/collections/snowboards', 'Collection Page'],
['/collections/snowboards/season2006+beginner', 'Collection Page (with tags)'],
['/collections/paginated-sale', 'Collection Page (Paginated, Page Nr.5)'],
- ['/products/arbor-draft', 'Product Page'],
+ ['/products/hooded-sweater', 'Product Page'],
['/cart', 'Shopping Cart'],
- ['/pages/about', 'Solo Page'],
+ ['/pages/about-us', 'Solo Page'],
['/blogs/bigcheese-blog/1', 'Article Page (with comments)'],
['/blogs/news/3', 'Article Page (no comments)'],
['/blogs/bigcheese-blog', 'Blog Page'],
View
8 server/db/database.yml
@@ -740,7 +740,7 @@ link_lists:
- *link-6
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-# Labels
+# Collections
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
collections:
@@ -768,6 +768,8 @@ collections:
title: Snowboards
handle: snowboards
url: /collections/snowboards
+ description:
+ <p>This is a description for my <strong>Snowboards</strong> collection.</p>
products:
- *product-1
- *product-2
@@ -830,8 +832,8 @@ pages:
- &page-3
id: 2
title: About Us
- handle: about
- url: /pages/about
+ handle: about-us
+ url: /pages/about-us
author: Tobi
content:
"<p>Our company was founded in 1894 and we are since operating out of Avignon from the beautiful Provence.</p>
View
49 themes/moderno/templates/collection.liquid
@@ -7,25 +7,42 @@
</div>
<div id="collection-right">
<div id="collection-desc">
- <h3>{{ collection.title }}</h3>{% if collection.description.size > 0 %}
- {{ collection.description }}{% endif %}
- </div>{% if collections.size > 0 %}
- <ul>{% for c in collections %}{% if c.handle != "frontpage" %}
- <li><a href="{{ c.url }}"{% if collection.url == c.url %} class="active"{% endif %}>{{ c.title | upcase }}</a></li>{% endif %}{% endfor %}
- </ul>{% else %}
- <p>Once you <a href="{{ shop.url }}/admin/custom_collections">add some collections</a>, they will be displayed like this...</p>
- <ul>
- <li><a href="">EXAMPLE COLLECTION 1</a></li>
- <li><a href="">EXAMPLE COLLECTION 2</a></li>
- <li><a href="">EXAMPLE COLLECTION 3</a></li>
- </ul>{% endif %}{% if collection.products.size > 0 %}
- <div id="descriptions">{% for product in collection.products %}
+ <h3>{{ collection.title }}</h3>
+ {% if collection.description.size > 0 %}
+ {{ collection.description }}
+ {% endif %}
+ </div>
+
+ {% if collections.size > 0 %}
+ <ul>
+ {% for c in collections %}
+ {% if c.handle != "frontpage" %}
+ <li><a href="{{ c.url }}"{% if collection.url == c.url %} class="active"{% endif %}>{{ c.title | upcase }}</a></li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>Once you <a href="{{ shop.url }}/admin/custom_collections">add some collections</a>, they will be displayed like this...</p>
+ <ul>
+ <li><a href="">EXAMPLE COLLECTION 1</a></li>
+ <li><a href="">EXAMPLE COLLECTION 2</a></li>
+ <li><a href="">EXAMPLE COLLECTION 3</a></li>
+ </ul>
+ {% endif %}
+ {% if collection.products.size > 0 %}
+ <div id="descriptions">
+ {% for product in collection.products %}
<div class="desc{% cycle 'description': ' left', '' %}">
<p><a href="{{ product.url | within: collection }}"><span>{{ forloop.index }}.</span> <span>{{ product.title }}</span> {{ product.description | strip_html | truncate: 120 }}</a></p>
<p class="desc-price">{{ product.price | money }}{% if product.compare_at_price_max > product.price %} <del>{{ product.compare_at_price_max | money }}</del>{% endif %}</p>
- </div>{% endfor %}
- </div>{% endif %}{% if paginate.pages > 1 %}
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ {% if paginate.pages > 1 %}
<div id="paginate">
{{ paginate | default_pagination }}
- </div>{% endif %}
+ </div>
+ {% endif %}
</div>{% endpaginate %}
Please sign in to comment.
Something went wrong with that request. Please try again.