General Suggestions

by Mark L - Member - 01:37AM, Jun 29, 2006

Based on my first few days playing around with this technology I have a couple of minor suggestions that would ease page custimization and make it a bit more flexible (if some are already available please forgive my ignorance) :

1. Add description association to collection. This will provide a generic way to display an overview describing a collection of items without having to hard code a case statement in the collections template, could just use {collection.description}.

2. The ability to access request query parameters … useful for created paged lists and many other things

3. Need a solution for shipping, at a bare minimum the ability to associate one or more shipping costs with each product either directly or through some classification scheme i.e. class. This would allow stores to implement custom shipping calculation algorithm with the details externalized at the product level. I am trying to work out exactly what I would need and will post back when I figure it out (unless anyone has a good solution for shipping costs already … please share).

4. The ability to specify height, width, and depth of products so that collections of products can be grouped by dimension. I presume the best way to do this now would be to specify this in the production description and tag the product in a dimension grouping … I guess this will actually work just fine.

5. String concatenation within expressions, could provide a very limited ability to perform simple logic AND operations. Something like {%if {str1 + str2} == ’?’ %}

6. Substring search that can be used in an if statement as well as a filter …

Anthony Bailey

Member

06:24PM, Jul 02, 2006

“Me too” re the first of those six suggestions.

--Anthony.

Boxhead

Member

08:51AM, Jul 20, 2006

Adding a ‘me too’ too.

Caroline Schnapp

Member

07:29PM, Jul 04, 2008

This has been implemented:

1. Add description association to collection. This will provide a generic way to display an overview describing a collection of items without having to hard code a case statement in the collections template, could just use {collection.description}.

Regarding no 2:

We have something similar, but we don’t get the tag filter. We have collection.url, for example, but it does not provide the complete URL in many instances, it does NOT provide the last argument, ie: the tag filter. I am actually struggling to read the active tag in collection.liquid now. I know how to print the collection tags and have the one active tag be wrapped with a <span class="active"></span>, and I am using the filter ‘highlight_active_tag’for that… but I am unable to read the active tag. How do I do this?

Me too on 2, 5 and 6.

---

Caroline from http://11heavens.com

tobi

jaded Pixel

09:49PM, Jul 04, 2008

6 is also implemented : {% if whatever includes 'substribg' %}

---

Tobias Lütke
Shopify – Founder, CEO

Caroline Schnapp

Member

11:12PM, Jul 04, 2008

Oh my God!

I will add this to the Wiki!

---

Caroline from http://11heavens.com

Caroline Schnapp

Member

11:24PM, Jul 04, 2008

I added the following case:

{% if user.name includes 'tobi' %} 
  hi tobias
{% endif %}

To this page: http://wiki.shopify.com/UsingLiquid

It’s kind of dumb, and I probably will come up with something better tomorrow.

---

Caroline from http://11heavens.com

Caroline Schnapp

Member

12:29AM, Jul 05, 2008

You can use the capture Tag for #5.

5. String concatenation within expressions, could provide a very limited ability to perform simple logic AND operations. Something like {%if {str1 + str2} == ’?’ %}

It might not be very elegant…

{% capture myConcatenation %}{{ str1 }}{{ str2 }}{% endcapture %}
{% if myConcatenation == 'someString' %}
---

Caroline from http://11heavens.com

Caroline Schnapp

Member

10:31PM, Jul 06, 2008

Tobi, the keyword ‘includes’ does not work.

---

Caroline from http://11heavens.com

tobi

jaded Pixel

12:32AM, Jul 07, 2008

Sorry, i confused myself. The actual keyword is “contains” :

{% if user.name contains ‘tobi’ %}

http://github.com/tobi/liquid/tree/master/test/if_else_test.rb#L123

---

Tobias Lütke
Shopify – Founder, CEO

Caroline Schnapp

Member

04:15AM, Jul 07, 2008

Yes, it works, thank you! I will update the wiki.

---

Caroline from http://11heavens.com

You must login to post a comment!

Don't have an account yet? Sign up for one.