Helma Logo
main list history

Helma 2 Templates - liquid sample

see http://home.leetsoft.com/liquid

  # Site/topiclist.skin
  <h1>{{ "site.topics.header" | i18n }}</h1>
  <p>
  {% if this.topics.count == 0 %}
    {{ "site.topics.noTopics" | i18n }}
  {% else if this.topics.count == 1 %}
    {{ "site.topics.oneTopic" | i18n }}
  {% else %}
    {{ "site.topics.moreTopics" | i18n }}
  {% endif %}
  {% for item in topiclist %}
     {% if forloop.first %}
      <table>
        <tr>
          <th>{{ "site.topics.tableHead.topic" | i18n }}</th>
          <th>{{ "site.topics.tableHead.numberOfStories" | i18n) }}</th>
        </tr>
     {% endif %}
        <tr class="row{{ forloop.index | modulo 2 }}">
          <td>{{ item.name }}</td>
          <td>{{ item.count }}</td>
        </tr>
     {% if forloop.last %}
      </table>
     {% endif %}
  {% endfor %}
  # Global/filters.js
  function i18n_filter(input) {
    if (getText(input)) {
      return this.renderSkin(createSkin(getText(input)));
    } else {
      return input;
    }
  }
  function modulo_filter(input, skinParam) {
    return 
  }
  # HopObject/macros.js
  function count_macro() {
    return this.count();
  }
  # Site/actions.js
  function topiclist_action() {
    this.renderSkin("topiclist", {topiclist: site.list()})
  }
  # locale/en.properties
  site.topics.header = All topics
  site.topics.noTopics = No topics to display.
  site.topics.oneTopic = This site has just one topic.
  site.topics.moreTopics = This site has {{ this.count }} topics.
  site.topics.tableHead.topic = Topic
  site.topics.tableHead.numberOfStories = Number of Stories

Links to this page: Helma 2 Templates