문제

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?

도움이 되었습니까?

해결책

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)

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top