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
{{ message }}
This repository was archived by the owner on Feb 11, 2021. It is now read-only.
Bastian Allgeier edited this page Aug 6, 2019
·
2 revisions
The blocks field method returns a Blocks collection. This is a typical Kirby collection object (comparable to Pages, Files, Users etc.) with all available Block objects.
Render the entire collection
If you want to get the HTML for all blocks in the collection you can use the html method or convert the collection to a string
<?=$page->text()->blocks() ?>
… or …
<?=$page->text()->blocks()->html() ?>
Looping through blocks
<?phpforeach ($page->text()->blocks() as$block): ?>
<!-- create some custom HTML for each block -->
<?phpendforeach?>