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

Nested assets not returned for $entry->all(); #310

Open
baj84 opened this issue Mar 17, 2022 · 3 comments
Open

Nested assets not returned for $entry->all(); #310

baj84 opened this issue Mar 17, 2022 · 3 comments

Comments

@baj84
Copy link

baj84 commented Mar 17, 2022

Hi,

I'm simply trying to get an entry with all it's nested links and assets, so that I can produce my page.

After reading #291 I am now looping through the entry and using $entry->all() which is returning 1 level of nested items. But how can I get all levels?

This seems like a really core part of having this library be useful - is there a work around?

@Sebb767
Copy link
Collaborator

Sebb767 commented Mar 22, 2022

Hi,

basically, you need to get all links and iteratively resolve them. I can create a code snippet that does this, if you'd like. As of now, the library is designed as a light wrapper around the API and very deeply linked structures are intentionally lazily resolved.

@baj84
Copy link
Author

baj84 commented Mar 22, 2022

@Sebb767 Thanks for your reply. So I would need to recursively loop through the tree and check for any Entry objects then call $entry->all() ?

If you could provide a snippet that would be muchly appreciated.

@baj84
Copy link
Author

baj84 commented Nov 1, 2022

@Sebb767 Could you please provide an example of how to do this? I'm stumped.

Thanks!

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

2 participants