FastNav plugin for carew

Installs: 5

Dependents: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

1.0.1-alpha 2013-06-23 17:00 UTC


FastNav plugin


My second plugin for carew is a « Fast Navigation » plugin.

This simple plugin help you create links to the previous and the next blog post of the current post.

You can see it in action at the bottom of each blog post on my blog

How to install it

A package is available on packagist in order to make it very simple for you to install.

All you have to do is to edit your composer.json file to add this requirement:

"bacardi55/carew-plugin-fastnav": "1.*dev"

Then, php composer.php update or php composer.php install depending on your case.

How to use it

Edit the carew config.yml file to enable the extension:

        - Carew\Plugin\FastNav\FastNavExtension

Then, in your twig blog post template file, you can use the following variables:

  • The previous post link:
  • The previous post title: document.metadatas.fastNav.prev.title
  • The next post link:
  • The next post title:

Here is a full example of how this plugin is used on my blog:

{% if document.metadatas.fastNav is not null %}
  <div class="fastNav">
    {% if %}
      <div class="prev pull-left">
        <a href="{{ }}">
          ← {{ document.metadatas.fastNav.prev.title }}
    {% endif %}
    {% if %}
      <div class="next pull-right">
        <a href="{{ }}">
          {{ }} →
    {% endif %}
{% endif %}
Source code

You can find the code on github here

The package can be found here on packagist.