News - CrystalCommerce Liquid Documentation for Designers

News

Linking to a product

Aug 19, 2012 Linking to a product

If you need to link to a product. but only know the name and the category, you can use the following URL that will redirect to the product page:

http://store.example.com/catalog/lookup?category=Tenth+Edition&name=Adarkar+Wastes

Which will then redirect to the product's page, if it can be found. If it can't be found, the user will be redirected to a search page for that category and product name.



Product Descriptor values

Aug 14, 2012 Product Descriptor values

Added product.descriptor_hash which exposes the product’s descriptors as downcased keys. So {{ product.descriptor_hash.card_type }} will return the value for the product’s Card Type descriptor (for example Creature).



Add descriptor_value_by_name

Jul 27, 2012 Add descriptor_value_by_name

We’ve added a feature to the global filters to look up a descriptor value by name. Here’s an example of how you would use it:

{% assign language = variant | descriptor_value_by_name: "Language" %}
{% if language == "English" %}
  Language: <img src="uk-flag.jpg" alt="English" />
{% else %}
  LOL I DUNNO?
{% endif %}

Note that it returns a falsy value if it isn't set OR if the variant doesn't have that descriptor at all.


Add debugging support to asset minification

Jul 2, 2012 Add debugging support to asset minification

We’ve added an option to the css_minify_tag liquid filter. For instance, if you had a config.yml file with the following:

css:
  all:
    - blue.css
    - css/red.css
    - /test.css

When you added this to your theme.liquid (note the new true option after css_minify_tag):

{{ "all" | css_minify_tag: true }}

It would render as:

<link href="/files/assets/blue.css?1340564403" type="text/css" media="screen" rel="stylesheet" />
<link href="/files/assets/css/red.css?1340564403" type="text/css" media="screen" rel="stylesheet" />
<link href="/test.css?1340564403" type="text/css" media="screen" rel="stylesheet" />


Updated multisearch to group by product name

May 16, 2012 Updated multisearch to group by product name

The multisearch/deckbuilder search has been updated.

  • Instead of using the search.liquid template to display results, it just re-renders the multi_search.liquid template. If the query variable is present, it will attempt to display the results.
  • The results are now grouped by their name, which should make for a more useful experience.

Added css_minify_tag and js_minify_tag

May 5, 2012 Added css_minify_tag and js_minify_tag

Added css_minify_tag and js_minify_tag, which in conjunction with the new theme config file will automagically minify your assets!

Update May 6: The minified assets don’t currently work with relative asset paths. We’re working on this and will update this when that is fixed.

Update May 6: Fixed! The minification of CSS files will now automatically rewrite the relative file paths to absolute. Contact support if you have any trouble with this feature.

As always, minifying javascript can cause problems for incorrectly formatted javascript (ie, missing semicolons). While the CSS minify is fairly straightforward, check your javascript console after switching to the minified javascript to make sure its working at intended.