Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping through collection items without site variables #703

Open
fritosxii opened this issue Apr 3, 2024 · 0 comments
Open

Looping through collection items without site variables #703

fritosxii opened this issue Apr 3, 2024 · 0 comments

Comments

@fritosxii
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant