Forum for discussing general topics related to Couch.
29 posts Page 3 of 3
For non-clonable templates, using relations will work but would be redundant as there is only one page to relate to. You can explicitly use cms:pages with masterpage set to the other language template(s) to get the corresponding values.
Ah of course, I've overthought that one! Thanks KK!
Hi, I've run into an more issue with the implementation of the media in the languages:

When placing media inside repeatable regions, the other language versions don't show the media.

So in the English version I have the code:

Code: Select all
<cms:repeatable name='services_gallery_images' label='Images'>
    <cms:editable type='image' name='services_gallery_image' label='Image' />
</cms:repeatable>


and then that reads out into the other language templates like this:

Code: Select all
<cms:show_repeatable 'services_gallery_images' >
    <img src="<cms:show services_gallery_image />" alt="" />
</cms:show_repeatable>


The media shows up in the english page but not in the other language pages. As a test, I tried wrapping a <cms:masterpage> tag around this which does then show the media but it shows all of the media for every page which uses the template.

Is there a way to do this?

Thanks, Daz
Hi, I've been racking my brain on the above issue but I can't come up with anything.

The names that I've added as the 'common fields' both read out when i do a <cms:dump /> but the gallery images (inside the repeatable) don't show any value.

Here's the lang code:

Code: Select all
<cms:lang_group
    en='en/services.php'
    fr='fr/services.php'

    _common_fields='services_title_image | services_gallery_image'
/>


and this reads out like...

services_title_image: http://localhost:8888/cms/uploads/image ... e/hero.jpg
services_gallery_image:


So the 'services_title_image' is a standard image field (working fine) and the 'services_gallery_image' is an image field inside a repeatable. I've tried all of the names for the repeatable but they all give no value.

Can you help?

Thanks
Daz
The issue reported by @Daz above was sorted out through PM back then but I failed to report that in this thread.

So, here is a belated follow-up to that repeatable-region issue for others who might be reading this thread -
it was indeed a bug which has been rectified. The 'multi_lang' addon attached with the current thread has since been updated.
Hi! :) I use this add-on (multi_lang.php) on my website. Now I want to switch to PHP7 and I receive such a message on the website:

Code: Select all
 Deprecated: Non-static method KMultiLang::lang_group_handler() should not be called statically in /var/www/admin/www/pommel.ru/update/parser/parser.php on line 397

Warning: Cannot modify header information - headers already sent by (output started at /var/www/admin/www/pommel.ru/update/parser/parser.php:397) in /var/www/admin/www/pommel.ru/update/cms.php on line 342

Could you help me deal with this problem?

There is also a choice between: PHP-FPM or CGI. Which is more preferable for CouchCMS?
@Jiwa, I have updated the attachment to make it PHP7 compatible. Please download it again from its original post.
As for your other question, both should work equally well so take your pick.

Hope it helps.
percy wrote: Best SEO approach for multilanguage sites is building quality links in multi languages. :D

Please give a sample :)
I used KK's excellent post (more like a tutorial) to implement multiple languages on my website. I have a couple of notes that may help others.

I had to set up multilanguage on 3 different clonable templates, with English as primary language and Spanish as secondary. Because 3 sets of templages were involved, I went through the conversion-to-multilang process several times.

I consistently found that if I made all the recommended changes at once (add cms:editable "relation" statement to my Spanish template as well as the cms:lang_group statement to both templates), I would get error messages like this:

Code: Select all
ERROR: Tag "related_pages": relation field 'related_page' not defined in es/index.php


As a result, the modified templates would not be registered. This gave be much grief for several hours.

Finally I discovered that I had to first add the cms:editable "relation" statement to my Spanish template, then register it, and only then add the cms:lang_group statement to both Spanish and English templates.

Another problem I had arose out of my lack of understanding of related fields and the workings of multi_lang.php. Multi_lang.php only provides access to related fields in page view of the template. If you deviate from that context by using for example list view in your template, in order to get the related fields you will need to invoke cms:related_pages and cms:reverse_related_pages, as explained here: https://docs.couchcms.com/concepts/rela ... ated-pages.

KK's multilanguage implementation is superb and is just what I need. Thanks!
29 posts Page 3 of 3