jigsaw icon indicating copy to clipboard operation
jigsaw copied to clipboard

Looping through collection items without site variables

Open fritosxii opened this issue 10 months ago • 0 comments

For some markdown collection (say $objects), I want to loop through the data of each $object for a Single Object type page:

@foreach($object as $index => $data)
    {{index}}: {{$data}}
@endforeach

My issue is I couldn't find a way to automatically filter out global Site Variables and Jigsaw metadata like production, baseUrl, title, description, collections, view.compiled, section, extends, path, sort, etc.

Right now looping through an $object includes these indices, when I only want the data in the YAML block of the $object's markdown file. Is there a function for this already? Any help is appreciated.

fritosxii avatar Apr 03 '24 13:04 fritosxii