# Get number of Structure Field like in Panel

**URL:** <https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 6, 2020, 7:59am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003 "2020-08-06T07:59:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bruno/32/6422_2.png) [@bruno](https://forum.getkirby.com/u/bruno)\
**Post date:** [August 6, 2020, 7:59am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003/1 "2020-08-06T07:59:47Z")

</div>

Is it possible to get the value of the ‘#’-column of a structure field?

I know I could do `$structureobject->indexOf() + 1` everywhere it’s needed, but this is not pretty nor is it possible in query language.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/a/a8887cf47a416b596f5f069e97e324804a822d2d.png)

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [August 6, 2020, 8:17am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003/2 "2020-08-06T08:17:58Z")

</div>

Since the number is not stored anywhere, you cannot fetch it in your templates or query language.

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [August 6, 2020, 8:34am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003/3 "2020-08-06T08:34:30Z")

</div>

What is the end result you are looking for? if its just for display purposes on the sites front end, you can use CSS Counters

> **[Using CSS counters](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters)**
>
> CSS counters let you adjust the appearance of content based on its location in a document. For example, you can use counters to automatically number the headings in a webpage. Counters are, in essence, variables maintained by CSS whose values may be...

---

<div class="post-metadata">

**Author:** ![bruno](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bruno/32/6422_2.png) [@bruno](https://forum.getkirby.com/u/bruno)\
**Post date:** [August 6, 2020, 8:48am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003/4 "2020-08-06T08:48:52Z")

</div>

wow, thanks for introducing me to CSS counters!

Unfortunately it won’t help – I need to get a number and a value from each structure field row and am trying to prevent the redundancy of a manual number field next to a numbered column…

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [August 6, 2020, 10:53am UTC](https://forum.getkirby.com/t/get-number-of-structure-field-like-in-panel/19003/5 "2020-08-06T10:53:27Z")

</div>

How do you want to use it in query language? In templates it is no problem, even if you don’t find it pretty.

You could of course use a hidden number field, but that would mean to update this all the time. A manual number field is useless, I think, because it would not update automatically if the order of the elements is changed.
