Language and Relationships Oddity

已查看 34 次
跳至第一个未读帖子

Ryan Simmons

未读,
2017年7月19日 15:40:442017/7/19
收件人 dotCMS User Group
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?
已删除帖子

Chris Falzone

未读,
2017年8月18日 09:29:492017/8/18
收件人 dot...@googlegroups.com
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!


--
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 dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
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.
回复全部
回复作者
转发
0 个新帖子