getPageList()

The Twig-function getPageList($navigation, $urlRel, $baseurl) returns the item of a folder that is referenced with a relative url. The function is useful if you want to list articles from any folder on any page, for example the articles of a news-folder on the startpage.

Example Usage

  {% set pagelist = getPageList(navigation, settings.themes.emergency.listpages, base_url) %}
  <ol class="postlist" reversed>
    {% for element in pagelist.folderContent %}
      {% set post = getPageMeta(settings, element) %}
      {% set date = element.order[0:4] ~ '-' ~ element.order[4:2] ~ '-' ~ element.order[6:2] %}
      <li>
         <a href="{{ element.urlAbs }}">{{ post.meta.title }}</a> <time datetime="{{date}}">({{ date | date("d.m.Y") }})</time>
      </li>

    {% endfor %}
  </ol>

Parameter

  • Param navigation: The full navigation.
  • Param relUrl: Relative url to a folder-page, can be a valid string from the theme settings or the UrlRel-property from an item.
  • Param baseurl: The [baseurl] as string.
  • Return: The item-object of a folder or ?.