Skip Navigation

[Resolved] many to many relation with multilanguage support

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
Setup many-to-many relationships between post types in different languages.
Solution:
There isn't such a build-in feature within Types or WPML,
You can setup the many-to-many relationships between different post types in same languaage.
Relevant Documentation:
https://wpml.org/faq/how-to-translate-custom-types/

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by augustoD 8 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#376519

I'm creating a site with 3 CPT and other 3 many-to-many relationship via CPT.

Also the site will be multilingual (using WPML) and I have some doubts:.

CPT posts will be multilingual (for each language, and display available language if one CPT is not translated), what about the post for the relationship? can I create a many-to-many relationship for posts in different languages? relationship should be also translated?

another question: it is possible to create lists for posts that are multilingual?

thanks

#376620

Q1) what about the post for the relationship? can I create a many-to-many relationship for posts in different languages? relationship should be also translated?

Yes, it is possible to create many-to-many relationship for posts in different languages, you just need to mark all related post types to be translatable, see WPML document:
https://wpml.org/faq/how-to-translate-custom-types/

And you will be able to translate the relationships.

Q2) It is possible to create lists for posts that are multilingual?
You can use Views shortcode [wpv-conditional] to check if current post has been translated, with WPML function wpml_element_has_translations():
https://wpml.org/wpml-hook/wpml_element_has_translations/
https://toolset.com/documentation/views-shortcodes/#wpv-conditional

#376688

Thanks for the reply, i need to add:

Q1.1: I don't need relations to be multilingual, i want to link CPT that are in different languages, ES_AR with EN_US and vice versa

Q1.2: so if i create a relationship with 2 the ES_AR posts i have to create another one for the EN_US translated versions?

Q2: when i make a list of post for the spanish version of the site, i want to list posts with default on ES_AR, and if a post does not have the ES_AR translation to show the EN_US. that for each post in the loop.

Will custom code be necessary?

#377031

Q1.1) and Q1.2) This is not possible within Types and WPML, you can not setup many-to-many relationships between between same post type of different lanuagage version (ES_AR and EN_US),

Q2) Yes, it needs custom PHP codes, you can the solution of WPML thread, for example:
https://wpml.org/forums/topic/display-default-language-if-no-translation-on-category-index-page/#post-272732

#377715

Ok thanks about that, one question about Q1.1 and Q1.2: what about creating many-to-many relationships between different custom post types (CPT1 in ES_AR linked to a CPT2 in EN_US).

Regards.

#377727

Sorry, there isn't such a build-in feature within Types or WPML, as I mentioned above:
You can setup the many-to-many relationships between different post types in same languaage.
Also you can check out our certified partners for it:
https://toolset.com/consultant/

#377820

OK, thanks for the support luoy

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.