Frage

I made a navigational bar at the left side of my blog and I wanted to add the list of pages that the user created into that navigational element. The problem is that I do not know how to loop through static pages. When looping through normal posts all users approach this method:

{{#foreach posts}}
....
....
....
{{/foreach}}

The above code is to loop through each post that exists and then the user has the choice to put whatever they want inside that piece of code. The problem is now looping through each static page.

Can anyone show me how to loop through static pages?

War es hilfreich?

Lösung

At this time, it is currently not possible to loop through static pages :(

That will prob come out when Apps do (aka someone will make an app for it)

Andere Tipps

I was searching for just this today and found a solution on this Github issue

{{#get "posts" filter="featured:true+page:true"}}
  {{#foreach posts}}
    ... do something with all featured pages...
  {{/foreach}}
{{/get}}

I just verified this locally.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top