# Why is "lower": null, "higher": null,?

**URL:** <https://zola.discourse.group/t/why-is-lower-null-higher-null/1450>\
**Category:** Uncategorized\
**Created:** [September 4, 2022, 7:32am UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450 "2022-09-04T07:32:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 4, 2022, 7:32am UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450/1 "2022-09-04T07:32:19Z")

</div>

Hello

I have read the documentation pages carefully 3 times and built a sample site following the docs, that does almost everything I will want. And I think Zola is excellent, does what it needs to and no more. The developers deserve a big applause.

but this is the one thing I don’t get. for a blog page, when I do {{ \_\_tera\_context }}, I get

```auto
 "lower": null, "higher": null, 

```

I tried every parameter combination I could think of and could not find any place in the documentation that says these are not always defined. or conditions under which they might not be defined.

I know I am missing something blindingly obvious.

I am on the latest zola on a mac (from 5 days ago), installed from brew.

thanks for making this great ssg

j

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 4, 2022, 2:30pm UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450/2 "2022-09-04T14:30:51Z")

</div>

OK, I solved it, sort of

Read the parent section variables in,

```auto
{% set assets = get_section(path="Assets/_index.md") %}

```

and that allows me to get the length, {{ assets.pages | length }}, access elements, {{ assets.pages[1].title }} and ultimately to put the next/last nav links on my posts, and have them roll over when at start/end.

But I assumed that is what lower/upper do automatically. Why I am puzzled why they are null. And this is super clumsy.

, all the best, and I am liking Zola more and more

j

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 4, 2022, 3:16pm UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450/3 "2022-09-04T15:16:46Z")

</div>

and if anybody is looking for a worked out example.

If correct, might be be nice to put into the documentation.

```auto

{% set assets = get_section(path="Assets/_index.md") %}
{% set n = assets.pages |length %}
{% for i in range(end=n) %}
    <h3>{{i}} {{ assets.pages[i].title}}</h3>
    {% if assets.pages[i] == page %}
        <h3> where we are at {{ page.title }}</h3>
        {% set last=i-1 %}
        {% set next=i+1 %}
        {% if last<0 %}
            {% set last=n-1 %}
        {%endif%} 
        {% if next> n-1 %}
            {% set next=0 %}
        {%endif%}       
        <h3>last {{last}} {{ assets.pages[last].title}} | this {{ assets.pages[i].title}} | next {{next}} {{ assets.pages[next].title}} </h3>
    {% endif%}
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 6, 2022, 1:49pm UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450/4 "2022-09-06T13:49:23Z")

</div>

> [@jack999](#):
>
> I tried every parameter combination I could think of and could not find any place in the documentation that says these are not always defined. or conditions under which they might not be defined.

It’s only filled if there is [Section | Zola](https://www.getzola.org/documentation/content/section/#sorting) set in the section because otherwise there is no sorting and hence no ordering.

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 6, 2022, 2:20pm UTC](https://zola.discourse.group/t/why-is-lower-null-higher-null/1450/5 "2022-09-06T14:20:24Z")

</div>

Thanks @keats, goes to show that when one thinks one has tried everything, there is still another parameter to set, and now it works!

do you mind if I ask you if my solution above is the right one if I want to it roll over, i.e. lower for post[0] to be post [n-1] ?

best, j
