You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a blogs collection which contains blog documents.
I have a pages collection that has tabbed fields. One of the tabs is called content (it's a named tab).
The content tab has a blocks type field called pageSections.
pageSectons can contain a carousel block that can reference blogs collection items. It also contains other blocks i.e hero, form block etc.
I have a simple revalidate hook that runs whenever the blogs or pages collection is updated. It calls revalidatePath with the slug of the collection that is being updated.
The issue is with updating related pages that uses content from the collection being updated.
For example:
The blogs collection documents contains a cardImage that is rendered in the carousel block in pages collection documents.
When the editor updates the cardImage in blogs I want to be able to find which collections reference the blogs collection document being updated and call revalidate path in those documents.
I have tried to use join field to get relationships, but I failed to get it work with blocks field.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I will get straight to the point.
blogs
collection which contains blog documents.pages
collection that hastabbed
fields. One of the tabs is calledcontent
(it's a named tab).content
tab has ablocks
type field calledpageSections
.pageSectons
can contain a carouselblock
that can referenceblogs
collection items. It also contains other blocks i.e hero, form block etc.I have a simple revalidate hook that runs whenever the
blogs
orpages
collection is updated. It callsrevalidatePath
with theslug
of the collection that is being updated.The issue is with updating related pages that uses content from the collection being updated.
For example:
The
blogs
collection documents contains acardImage
that is rendered in the carouselblock
inpages
collection documents.When the editor updates the
cardImage
inblogs
I want to be able to find which collections reference theblogs
collection document being updated and call revalidate path in those documents.I have tried to use
join
field to get relationships, but I failed to get it work withblocks
field.Beta Was this translation helpful? Give feedback.
All reactions