Skip to content

liquid_page_default_collection

Vladimir Krõlov edited this page Jul 21, 2014 · 4 revisions

Default Collection

Each collection can be paginated. TODO: add example

Search by item

To get specific record you can use:

  • collection.handle_name
  • collection['handle_name']

Methods

  • each - returns an iterator
  • count
  • any? - returns true if at least 1 element exists
  • many? - returns true if at least 2 elements exist
  • one? -returns true if only 1 element exists
  • empty? - returns true if 0 elements exists
  • first
  • last
  • to_a - makes an array. After this method you cannot use search for example