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.
blogscollection which contains blog documents.pagescollection that hastabbedfields. One of the tabs is calledcontent(it's a named tab).contenttab has ablockstype field calledpageSections.pageSectonscan contain a carouselblockthat can referenceblogscollection items. It also contains other blocks i.e hero, form block etc.I have a simple revalidate hook that runs whenever the
blogsorpagescollection is updated. It callsrevalidatePathwith theslugof the collection that is being updated.The issue is with updating related pages that uses content from the collection being updated.
For example:
The
blogscollection documents contains acardImagethat is rendered in the carouselblockinpagescollection documents.When the editor updates the
cardImageinblogsI want to be able to find which collections reference theblogscollection document being updated and call revalidate path in those documents.I have tried to use
joinfield to get relationships, but I failed to get it work withblocksfield.Beta Was this translation helpful? Give feedback.
All reactions