Skip to content

Commit

Permalink
Attempt fixing navigation on item detail page #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ParitoshBh committed Mar 10, 2020
1 parent e2c8cb9 commit ca80c3e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions templates/item.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'partials/base.html.twig' %}
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
{% set pageCollection = page.parent.children() %}

{% block body %}
<section class="container post">
Expand Down Expand Up @@ -36,11 +37,15 @@
{% if theme_config.post.navigation %}
<footer class="page-footer">
<div>
{% if not page.isLast %}
<div class="float-left"><i class="far fa-hand-point-left"></i> <a href="{{ page.prevSibling.url }}">Previous Article</a></div>
{% if not pageCollection.isLast(page.path) %}
<div class="float-left">
<i class="far fa-hand-point-left"></i> <a href="{{ pageCollection.prevSibling(page.path).url }}">Previous Article</a>
</div>
{% endif %}
{% if not page.isFirst %}
<div class="float-right"><a href="{{ page.nextSibling.url }}">Next Article</a> <i class="far fa-hand-point-right"></i></div>
{% if not pageCollection.isFirst(page.path) %}
<div class="float-right">
<a href="{{ pageCollection.nextSibling(page.path).url }}">Next Article</a> <i class="far fa-hand-point-right"></i>
</div>
{% endif %}
</div>
</footer>
Expand Down

0 comments on commit ca80c3e

Please sign in to comment.