Next and previous links on blog posts (Using PHP Twig language)
- or -
Post a project like this3431
£25(approx. $31)
- Posted:
- Proposals: 2
- Remote
- #600419
- Awarded
Description
Experience Level: Intermediate
General information for the website: Online interviews
Kind of development: Customization of existing website
Description of requirements/features: I need someone WHO KNOWS THE TWIG LANGUAGE (http://twig.sensiolabs.org/)
I am using Stacey V.3 app for a small site of mine. On my blog posts I would like to have a previous and next link to navigate through different posts. Easy. What I would like to do now is on my last post remove the 'next' link which would essentially be a link to the very first post of my collection.
Something like this ....
{% for sibling in page.siblings %}
{% if loop.first %}
{% include 'partials/next-page.html' %}
{% elseif loop.last %}
{% include 'partials/prev-page.html' %}
{% else %}
{% include 'partials/prev-page.html' %}
{% include 'partials/next-page.html' %}
{% endif %}
{% endfor %}
My knowledge of Twig and PHP could be written on the head of a pin. So, i'll be honest with you. I am trying to do something like this
{if the current post is last dont show a previous link} {if the current post is first dont show a next link}
{else}
{show a next and previous link on every post}
Similar urls: http://samking.co/adventures/
Extra notes: Go to http://samking.co/adventures/ and click in one of the projects. SCROLL TO THE BOTTOM.
The last post *only* has a previous link and the first post *only* has a next link.
Kind of development: Customization of existing website
Description of requirements/features: I need someone WHO KNOWS THE TWIG LANGUAGE (http://twig.sensiolabs.org/)
I am using Stacey V.3 app for a small site of mine. On my blog posts I would like to have a previous and next link to navigate through different posts. Easy. What I would like to do now is on my last post remove the 'next' link which would essentially be a link to the very first post of my collection.
Something like this ....
{% for sibling in page.siblings %}
{% if loop.first %}
{% include 'partials/next-page.html' %}
{% elseif loop.last %}
{% include 'partials/prev-page.html' %}
{% else %}
{% include 'partials/prev-page.html' %}
{% include 'partials/next-page.html' %}
{% endif %}
{% endfor %}
My knowledge of Twig and PHP could be written on the head of a pin. So, i'll be honest with you. I am trying to do something like this
{if the current post is last dont show a previous link} {if the current post is first dont show a next link}
{else}
{show a next and previous link on every post}
Similar urls: http://samking.co/adventures/
Extra notes: Go to http://samking.co/adventures/ and click in one of the projects. SCROLL TO THE BOTTOM.
The last post *only* has a previous link and the first post *only* has a next link.
Ed V.
100% (1)Projects Completed
3
Freelancers worked with
3
Projects awarded
100%
Last project
9 Dec 2014
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies