Hello everyone, does anyone know how I can make a query to filter by locale the localized registries related to non-localized collections?
This topic has been created from a Discord post (1239946698827108352) to give it more visibility.
It will be on Read-Only mode here. Join the conversation on Discord
You should be able to add a non-localized relationship with an entity that uses localization, but I don’t think that the relationship field will be localized. This means the same related entities will be displayed across all localizations.
Maybe try:
Go to the Strapi Admin panel.
Navigate to Content-Types Builder under plugins section.
Click on the content type you want to add a relationship to.
Click on the Add New Field button.
In the new screen, choose the “Relation” field type. Fill in the details of the relation:
5.a Select the related collection type.
5.b Select the type of the relation (one-to-one, one-to-many, many-to-one, or many-to-many).
You can then save the relationship. If the entity is localized, the relationship field by default will not be localized - same related entities will be shown across all localizations.
Also, if you need to have different related entities per localization, I think you’ll need to handle it manually (e.g. using custom code you could hide or show relations depending on the current localization)