Get related post of the same tags

Hi, Im looking for a way to show related post at the bottom of my article. Basically, show 3 posts that share the same tag.

If I could add a parameter to includes related post from the specific tag of the present article it would be super cool :slight_smile: Or just a way to access my current tags… Im using vuejs

Thanks

Hello! :wave:t2:

You can use the [in] operator to query for entries with a given tag. :point_right:t2: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/inclusion

E.g. taking my own website as an example:

https://cdn.contentful.com/spaces/xxx/entries?content_type=post&order=-fields.date&limit=2&fields.tags\[in\]=javascript

I can query all posts that include the tag javascript with the query above.

Hope that helps. :slight_smile:

1 Like