Rich Text Link runs into data load issue cause of missing depth/maxDepth #3952
Replies: 3 comments 3 replies
-
Hey Marvin, You could use a hook on your rich text field to "pair down" the data from the referenced pages. Alternatively, we are building a feature that allows you to select specific fields from populations, which will help you here. But for now, this is not an issue with Payload - instead, it's a feature request so I will convert it accordingly to a Feature Request Discussion. Will you try the hooks method for your rich text field? |
Beta Was this translation helpful? Give feedback.
-
So I've found a way to solve this problem using an On your richText field add an afterRead hook
In the hook, you can add a value to the request context
With a little bit of background info for my specific use case, I am only allowing
And that's it! |
Beta Was this translation helpful? Give feedback.
-
It's not in the docu right now, but you can add a |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
I encountered an issue related to data loading. On a single page, I have several richText fields, and this page contains numerous internal links (around 50) to other pages of my website, each of them also contains cross-links. As a result, I'm experiencing a huge, redundant data load because every link is loading basically the content of two pages when I actually only require the slug to handle the link in the frontend. So my website takes ages to load. It would be great, if you adjust the depth of richText links.
I was trying a bit of stuff, but this is unfortunately not working:
Note: I can't set the depth in my payload settings to 1, since I have other components, where depth 2 is required.
To Reproduce
-> Here you go: i.e. for 20 Links you load 60 entire pages.
Payload Version
1.14.0
Adapters and Plugins
No response
Beta Was this translation helpful? Give feedback.
All reactions