The community member has a multiple category blog and is trying to display related posts in the footer based on the category of the current post. The post variable resource contains the category value, but the community member is unable to filter the related posts collection using this value. The community members suggest several options to address this issue, such as rendering the related posts on the client-side, adding the category to the URL, or using a custom backend to stitch the requests together. The community members also discuss the possibility of customizing the CMS to provide the necessary data in a single response.
I got a multiple category blog and on the dynamic post page I'm attempting to create a footer section to display related posts based on the category of the current post. The post variable resource (located in the body) contains the category value along with all the blog post data (title, content, dates, etc.) and is matching correctly with the dynamic slug.
The problem is that for the related posts footer I can't find a way to let the related posts collection component filter out posts using the category value that coming from the Post Variable Resource (in the body).
Is there a way to add data from the first collection (Post Variable Resource) to the second collection (Related Post Resource)?
In the screenshot attached I need to dynamically add the category value from the Post Variable Resource into "value": "my-url-slug" which is in the Related Post Resource.
Any pointers on how to accomplish this would be greatly appreciated.
another option is to have. a custom backend that stitches requests together and provdes everything in one request to webstudio - then is server rendered
This is how I have it in the dynamic category page. Since the category is in the url is easy to filter the matching related posts. However in the post page I can't do that because the category does not exist in the url.