Skip to content

Next: Fetching data from Collections and using it in a Region

russellhutsonmicro-p edited this page Dec 1, 2017 · 1 revision

Cockpit-Next

If you want to use collection data in a Region Template, fetch the data like this:

<?php $newsArticles = cockpit("collections")->find("MyNewsCollection",['sort'=>['startdate'=>-1]]);

foreach ($newArticles as $article) {.....}