Language and Relationships Oddity

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Language and Relationships Oddity

Ryan Simmons
We are running into an issue where single content types in multiple languages, requiring multiple relationships, are only showing one relationship.

Here's the scenario.

Let's say we have a page asset called "Barbecue Recipe". We want to create for this page with an English, French and Spanish translation for Barbecue Recipe. We're good so far.

Here's where we are having trouble.

We want to assign different relationships for the different language versions of the Barbecue Recipe content item, something like this:

Content Item #1 on that page:
Barbecue Recipe (EN) --> American Restaurant
Barbecue Recipe (FR) --> French Restaurant
Barbecue Recipe (ES) --> Mexican Restaurant

Content Item #2 on that page:
Barbecue Recipe (FR) --> Belgian Restaurant
Barbecue Recipe (ES) --> Costa Rican Restaurant

We have to have multiple content items because you can't have more than one French language translation per content item, so if we want to create custom content for a specific country that also speaks French, we need that second content item. We post both of these content items to that page asset.

Functionally, this is working. In our velocity, we can detect the language and the country via the URL on a customized container, and pull the related content so that the right piece of content shows up on the page. If our URL says /fr/be, we see the French Belgian content, and nothing else. So far, so good.

But in the backend, when we go back to edit either of these content items, we see one relationship applied to all the language versions of a content item.

We expect this:

Content Item #1
Language Chosen --> English --> Relationship visible --> American Restaurant
Language Chosen --> French --> Relationship visible --> French Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

But see this:

Language Chosen --> English --> Relationship visible --> Mexican Restaurant
Language Chosen --> French --> Relationship visible --> Mexican Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

Oddly, our relationships are still working correctly as far as the frontend goes. Based on the URL, the right content is getting pulled and displayed (and the wrong content is not). So it seems like relationships are unique for different language versions of a contentlet, but the relationship field isn't reflecting that in the backend.

Any thoughts on how we can correct this?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/ef82c4bf-a582-4065-8a86-9f36012e3f99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Language and Relationships Oddity

sa1512097
Check out here..
http://thehiddencardinal.com/l.php?link=//OkyYQzpVKGWuZ1L/gm/en/?i=1480131

On Wednesday, July 19, 2017 at 12:40:44 PM UTC-7, Ryan Simmons wrote:
We are running into an issue where single content types in multiple languages, requiring multiple relationships, are only showing one relationship.

Here's the scenario.

Let's say we have a page asset called "Barbecue Recipe". We want to create for this page with an English, French and Spanish translation for Barbecue Recipe. We're good so far.

Here's where we are having trouble.

We want to assign different relationships for the different language versions of the Barbecue Recipe content item, something like this:

Content Item #1 on that page:
Barbecue Recipe (EN) --> American Restaurant
Barbecue Recipe (FR) --> French Restaurant
Barbecue Recipe (ES) --> Mexican Restaurant

Content Item #2 on that page:
Barbecue Recipe (FR) --> Belgian Restaurant
Barbecue Recipe (ES) --> Costa Rican Restaurant

We have to have multiple content items because you can't have more than one French language translation per content item, so if we want to create custom content for a specific country that also speaks French, we need that second content item. We post both of these content items to that page asset.

Functionally, this is working. In our velocity, we can detect the language and the country via the URL on a customized container, and pull the related content so that the right piece of content shows up on the page. If our URL says /fr/be, we see the French Belgian content, and nothing else. So far, so good.

But in the backend, when we go back to edit either of these content items, we see one relationship applied to all the language versions of a content item.

We expect this:

Content Item #1
Language Chosen --> English --> Relationship visible --> American Restaurant
Language Chosen --> French --> Relationship visible --> French Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

But see this:

Language Chosen --> English --> Relationship visible --> Mexican Restaurant
Language Chosen --> French --> Relationship visible --> Mexican Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

Oddly, our relationships are still working correctly as far as the frontend goes. Based on the URL, the right content is getting pulled and displayed (and the wrong content is not). So it seems like relationships are unique for different language versions of a contentlet, but the relationship field isn't reflecting that in the backend.

Any thoughts on how we can correct this?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3d7f0605-73ea-415f-9599-088285bac335%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Language and Relationships Oddity

dotCMS Users Group mailing list
In reply to this post by Ryan Simmons
You can have multiple relationships on a contentlet, just set it one to many instead of one to one.

So you can have BBQ Recipe (FR) related to both French Restaurant and Belgian Restaurant.  

Also languages in dotCMS are not just language, they also include country.  So you can have both fr_FR and fr_BE languages defined in your system.  We actually use 4 different english translations for each of our english websites:  en_US, en_UK, en_NL, en_AU. 

The supported format is:  [2 letter language code]_[2 letter country code]
Country Code Reference:  https://en.wikipedia.org/wiki/ISO_3166-1 (refer to Alpha2 Codes)

Hope that helps!


On Wed, Jul 19, 2017 at 3:40 PM Ryan Simmons <[hidden email]> wrote:
We are running into an issue where single content types in multiple languages, requiring multiple relationships, are only showing one relationship.

Here's the scenario.

Let's say we have a page asset called "Barbecue Recipe". We want to create for this page with an English, French and Spanish translation for Barbecue Recipe. We're good so far.

Here's where we are having trouble.

We want to assign different relationships for the different language versions of the Barbecue Recipe content item, something like this:

Content Item #1 on that page:
Barbecue Recipe (EN) --> American Restaurant
Barbecue Recipe (FR) --> French Restaurant
Barbecue Recipe (ES) --> Mexican Restaurant

Content Item #2 on that page:
Barbecue Recipe (FR) --> Belgian Restaurant
Barbecue Recipe (ES) --> Costa Rican Restaurant

We have to have multiple content items because you can't have more than one French language translation per content item, so if we want to create custom content for a specific country that also speaks French, we need that second content item. We post both of these content items to that page asset.

Functionally, this is working. In our velocity, we can detect the language and the country via the URL on a customized container, and pull the related content so that the right piece of content shows up on the page. If our URL says /fr/be, we see the French Belgian content, and nothing else. So far, so good.

But in the backend, when we go back to edit either of these content items, we see one relationship applied to all the language versions of a content item.

We expect this:

Content Item #1
Language Chosen --> English --> Relationship visible --> American Restaurant
Language Chosen --> French --> Relationship visible --> French Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

But see this:

Language Chosen --> English --> Relationship visible --> Mexican Restaurant
Language Chosen --> French --> Relationship visible --> Mexican Restaurant
Language Chosen --> Mexican --> Relationship visible --> Mexican Restaurant

Oddly, our relationships are still working correctly as far as the frontend goes. Based on the URL, the right content is getting pulled and displayed (and the wrong content is not). So it seems like relationships are unique for different language versions of a contentlet, but the relationship field isn't reflecting that in the backend.

Any thoughts on how we can correct this?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/ef82c4bf-a582-4065-8a86-9f36012e3f99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgUzUF_ii2fes_9TPoTDQ7kkzoBd%2B6bbPD3gZTTXQz%3DkVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.