You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if I should be asking this question elsewhere, but I'm trying to create a data driven website and am wondering whether its possible to paginate on my data if its not in a array.
I basically want to group on a certain key which I can do with my current structure (see below) using the group key and the groupby utility.
My current structure is a big array and I can paginate off it and display it on my index page:
[
{
"code": 200,
"title": "Found",
"group": "2XX"
},
{
"code": 301,
"group": "3XX",
"title": "Moved Permanently",
"description": "Hello\nThis is on a new line\n",
"nav": "warning"
}
]
This all works fine, no issues so far! What I'm wondering is whether its possible to structure my data differently but still achieve the above. I'd like to structure it like this (or something like it):
And group on the first set of keys, looping over each array inside it (ie each array under 2XX) and again, paginating on those. I'm 99% sure this isn't possible but just thought I'd check!
Apologies if this doesn't make any sense! I'm loving 11ty so far though!
Edit: Forgot to mention I'm using Nunjucks templates so the specific group by stuff should likely be asked there, I guess I'm just curious about the pagination ability!
The text was updated successfully, but these errors were encountered:
Sorry if I should be asking this question elsewhere, but I'm trying to create a data driven website and am wondering whether its possible to paginate on my data if its not in a array.
I basically want to group on a certain key which I can do with my current structure (see below) using the
group
key and thegroupby
utility.My current structure is a big array and I can paginate off it and display it on my index page:
Index:
Pages:
This all works fine, no issues so far! What I'm wondering is whether its possible to structure my data differently but still achieve the above. I'd like to structure it like this (or something like it):
And group on the first set of keys, looping over each array inside it (ie each array under
2XX
) and again, paginating on those. I'm 99% sure this isn't possible but just thought I'd check!Apologies if this doesn't make any sense! I'm loving 11ty so far though!
Edit: Forgot to mention I'm using Nunjucks templates so the specific group by stuff should likely be asked there, I guess I'm just curious about the pagination ability!
The text was updated successfully, but these errors were encountered: