Typemill   ›   Theme Developers   ›   Theme Functions   ›   getPageMeta

getPageMeta()

The Twig-function {{ getPageMeta(settings,pageItem) }} returns the metadata of a page as an array. The function can be used to list meta-information like meta-title and meta-description of pages inside a folder.

Parameter

Parameter Type Required? Description
settings array required The settings variable.
pageItem array required The item variable of a page.

Return

This function return the meta-data of a page as an array.

Example Usage

If the current item is a folder, then you can loop through item.folderContent. Alternatively you can get items from the navigation with getPageList.

    <ul>

      {% for article in item.folderContent %}
        {% set page = getPageMeta(settings, article) %}
        <li>
          <a href="{{ article.urlAbs }}">
              <h2>{{ article.name }}</h2>
              <small>{{ page.meta.modified }} | {{ page.meta.author }}</small>
              <p>{{ page.meta.description }}</p>
          </a>
        </li>

      {% endfor %}
    </ul>