Help with getting started in views
Created 7 years ago by gonziisI'm new to this framework and there are some things I can't wrap around my mind yet, It seems like there aren't enough documentation and examples covering this. Do I look just in twig or Laravel documentation? The thing is, I want to list all activated pages in my layout/view. It's such a simple thing, yet I waste so much time trying to achieve it.
{% for page in pages %} test {% endfor %} Shouldn't it be like this? What would be the correct target variable? I feel like I'm missing something major here.
@gonziis the entries method is pretty well documented - it's basically all the same objects too - so a page has a title / slug / etc. As well as relations like page.parent.title.
https://pyrocms.com/documentation/streams-platform/1.3/plugin/entries
The way you "use" the object in question (here it's page) is determined by the type of field that represents the attribute you're accessing. For example the page's slug is a slug field type so you can do page.slug.humanize because of this: https://pyrocms.com/documentation/slug-field-type/2.1/usage/presenter-output#slugfieldtypepresenter-humanize
With twig, you could also do