This page last changed on Feb 23, 2012 by jed.wheeler@involver.com.
social_catalog
The social_catalog system is used to build a catalog of items in SML. It can accept shopping.com csv, google csv, and google xml format feeds and will automatically create a set of content items using the data from the feed you import.
Attributes
name |
type |
value |
active_catalog_items |
array |
Returns array of social_catalog items |
pending_catalog_items |
array |
Returns array of social_catalog items |
archived_catalog_items |
array |
Returns array of social_catalog items |
featured_item |
social_catalog_item |
Returns the featured item |
Configuration
Image crop - Pick the orientation of all the images in your catalog. You must re-crop all of your images after you save this change.
Show price - Show your items' prices in the catalog
Caching issues
Examples
SML tags to enable Social Catalog:
{% social_catalog %}{% endsocial_catalog %}
This will display the default template.
A very basic configuration
{% social_catalog %}
<ul>
{% for content_item in social_catalog.active_catalog_items %}
<li>
<h3><a href="{{ content_item.buy_url}}">{{ content_item.title}}</a></h3>
<p>{{ content_item.description | truncate:240 }}
<a href="{{ content_item.buy_url}}">Read More</a></p>
<p><strong>{{ content_item.price}}</strong></p>
</li>
{% endfor %}
</ul>
{% endsocial_catalog %}
With ratings on the products and the items sorted by average rating
{% social_catalog %}
<ul>
{% for content_item in social_catalog.active_catalog_items sort_by:"rating" %}
<li>
<h3><a href="{{ content_item.buy_url}}">{{ content_item.title}}</a></h3>
<p>{{ content_item.description | truncate:240 }}
<a href="{{ content_item.buy_url}}">Read More</a></p>
<p><strong>{{ content_item.price}}</strong></p>
{% rate content_item %}
</li>
{% endfor %}
</ul>
{% endsocial_catalog %}
|