diff --git a/example/server/example_servlet.rb b/example/server/example_servlet.rb index 16f3bff..971e9c5 100644 --- a/example/server/example_servlet.rb +++ b/example/server/example_servlet.rb @@ -23,7 +23,7 @@ class Servlet < LiquidServlet end def products - { 'products' => products_list, 'description' => description, 'section' => 'Snowboards', 'cool_products' => true} + { 'products' => products_list, 'more_products' => more_products_list, 'description' => description, 'section' => 'Snowboards', 'cool_products' => true} end private @@ -34,6 +34,11 @@ class Servlet < LiquidServlet {'name' => 'Arbor Diamond', 'price' => 59900, 'description' => 'the *arbor diamond* is a made up product because im obsessed with arbor and have no creativity'}] end + def more_products_list + [{'name' => 'Arbor Catalyst', 'price' => 39900, 'description' => 'the *arbor catalyst* is an advanced drop-through for freestyle and flatground performance and versatility' }, + {'name' => 'Arbor Fish', 'price' => 40000, 'description' => 'the *arbor fish* is a compact pin that features an extended wheelbase and time-honored teardrop shape'}] + end + def description "List of Products ~ This is a list of products with price and description." end diff --git a/example/server/templates/products.liquid b/example/server/templates/products.liquid index 374b029..779bd4d 100644 --- a/example/server/templates/products.liquid +++ b/example/server/templates/products.liquid @@ -16,12 +16,12 @@ - + {% assign all_products = products | concat: more_products %}

{{ description | split: '~' | first }}

{{ description | split: '~' | last }}

-

There are currently {{products | count}} products in the {{section}} catalog

+

There are currently {{all_products | count}} products in the {{section}} catalog

{% if cool_products %} Cool products :) @@ -31,7 +31,7 @@