gnugat/carew-next

This package is abandoned and no longer maintained. No replacement package was suggested.

Plugin for carew, add next_document and previous_document functions

v1.0.0 2015-04-09 18:34 UTC

This package is auto-updated.

Last update: 2022-02-01 12:46:22 UTC


README

This Carew plugin adds two new functions:

  • next_document()
  • previous_document()

With these, you'll be able to automatically have links pointing to the next and previous pages:

{% block content_main %}
    {{ carew.document.body|raw }}

    <ul>
        {% set next = next_document(carew.posts, carew.document) %}
        {% if next %}
        <li>Next: <a href="{{ render_document_path(next) }}">{{ next.title }}</a></li>
        {% endif %}

        {% set previous = previous_document(carew.posts, carew.document) %}
        {% if previous %}
        <li>Previous: <a href="{{ render_document_path(previous) }}">{{ previous.title }}</a></li>
        {% endif %}
    <ul>
{% endblock %}

Installation

Use Composer:

composer require "gnugat/carew-next:~1.0"

Then register the plugin:

engine:
    extensions:
        - Gnugat\CarewNext\NextExtension

Further documentation

You can see the current and past versions using one of the following:

You can find more documentation at the following links: