and then slicing the array to get e.g. three random items - on every single blog post page generation - doesn't seem like the best way to do this. I will end up with a static generated site in the end, but still doesn't seem right
I might need some more information about what you are trying to implement.
What I understood is that you want to suggest some random articles automatically with the same Custom Type.
If that is the case, the way you have suggested can work, but It might be better to use the similar predicate somehow to suggest other pages. For more, please refer to this article.
Another way to implement (the way implemented in our docs) would be by creating a Slice w/ Content Relationships or using a Group field to select certain documents to display at the bottom of the page.
This way, you can select documents that you think are actually relevant to the user at that time. But this will require the content author(s) to add these for each page,
Fares
Fares
closed , flag & select 'Something Else' to reopen.
6
This thread has been closed due to inactivity. Flag to reopen.