# Is there a way to render section pagination inside page?

**URL:** <https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100>\
**Category:** Support\
**Created:** [April 7, 2024, 10:54am UTC](https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100 "2024-04-07T10:54:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liavhibe](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/liavhibe/32/1197_2.png) [@liavhibe](https://zola.discourse.group/u/liavhibe)\
**Post date:** [April 7, 2024, 10:54am UTC](https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100/1 "2024-04-07T10:54:44Z")

</div>

Hi 🙂

I’m trying to recreate my Hugo website in Zola. my website is structured in a way that the articles section has a list of articles with pagination component (that’s easy) but I want to article page itself to show the pagination from the article page, so the website layout stays the same. this is the image of the layout:

 ![image](https://global.discourse-cdn.com/free1/uploads/zola1/original/2X/3/3df59103048c8e4cb8044258a4ba5cb0172ab22b.png)

1 - is the article list  
2 - is the article

I want to generate the article list pagination inside the article page (with next and prev buttons and list of articles).

is there a way to do it?

in Hugo I can use the {{ with }} to change the context of the specific part of the template. but in Zola I always get an error that there is no paginator.

I hope I was clear, thanks for the help!

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [May 6, 2024, 9:57pm UTC](https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100/2 "2024-05-06T21:57:54Z")

</div>

I’m not entirely sure I’ve correctly understood your goals; a link to your Hugo theme demo would be useful.

> [@liavhibe](#):
>
> article list pagination inside the article page

Do you want a section in your articles that has something like:

← Previous article | Next article →

?

If that’s it, I added this functionality to my theme recently. You can see the code, a screenshot and context on the [PR](https://github.com/welpo/tabi/pull/246/). The relevant part of the code:

```auto
{%- if page.lower or page.higher -%}
<nav class="full-width article-navigation">
    <div>
    {%- if page.lower -%}
    <a href="{{ page.lower.permalink | safe }}">&#8249; {{ page.lower.title | truncate(length=100) }}</a>
    {%- endif -%}
    </div>
    <div>
    {%- if page.higher -%}
    <a href="{{ page.higher.permalink | safe }}"> {{ page.higher.title | truncate(length=100) }} &#8250;</a>
    {%- endif -%}
    </div>
</nav>
{%- endif -%}

```

---

<div class="post-metadata">

**Author:** ![liavhibe](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/liavhibe/32/1197_2.png) [@liavhibe](https://zola.discourse.group/u/liavhibe)\
**Post date:** [May 11, 2024, 6:56am UTC](https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100/3 "2024-05-11T06:56:00Z")

</div>

hi, thanks for replying.

I wanted to generate the article list (1) inside the article page.

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [May 11, 2024, 12:15pm UTC](https://zola.discourse.group/t/is-there-a-way-to-render-section-pagination-inside-page/2100/4 "2024-05-11T12:15:54Z")

</div>

Understood!

You can do this:

```tera
{% set last_ancestor = page.ancestors | slice(start=-1) %}
{% set current_section = get_section(path=last_ancestor.0) %}

{%- if current_section.pages -%}
<nav class="full-width article-navigation">
    <ul>
    {%- for page in current_section.pages %}
        <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
    {%- endfor %}
    </ul>
</nav>
{%- endif -%}

```

I’m not sure it’s the most efficient way to go about it, but it works! It shows a list of all article titles in that section.

If you want the description and so on, just add those variables (e.g. `{{ page.description }}`) in the loop.

Hope that helps~
