[[YAMS? &get=`text` &from=`en:hello|fr:bonjour|ja:こんにちは|gr:γειά σου`]]
[[YAMS? &get=`text` &from=`en::hello||fr::bonjour||ja::こんにちは||gr::γειά σου`]]
The document for each language is calling:
[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`(yams_mname)`]]
and displays an error:
Language file does not exist Please check: ..../assets/snippets/ditto/lang/russian-UTF8.inc.php
[[YAMS? &get=`chunk` &from=`dittocall`]]
[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`russian-UTF8` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`]]
I’ll investigate this tonight and get back to you. (About 8 hours from now for me.)
Chunk call from [[YAMS? &get=`chunk` &from=`dittocall`]] did not help.
No results.
There are problems with the placeholders [+ previous +] [+ pages +] [+ next +] when calling:
<p>[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`engilish`]]</p>
<p>Showing [+start+] - [+stop+] of [+total+] Articles</p>
<p>Pages.: [+previous+] [+pages+] [+next+]</p>
Example:[+next+] = http://example.com/news?yams_lang=en&start=5
Clicking this link will be made to redirect to default language, in my example, the transition will be made http://example.com/news?yams_lang=ru&start=5
[[YAMS? &get=`content` &from=`content` &docid=`[*id*]`]]
[*content*]
[[YAMS? &get=`content` &docid=`[+id+]` &from=`pagetitle`]]
[+pagetitle+]
I just checked this out and it worked for me. I took a look at your site and I noticed that you only had one dittocall chunk. Actually you need one for each language like so
Quote from: jonimant at Aug 02, 2009, 07:22 PMI’ll investigate this tonight and get back to you. (About 8 hours from now for me.)
Chunk call from [[YAMS? &get=`chunk` &from=`dittocall`]] did not help.
No results.
[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`english` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`]]
[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`russian-UTF8` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`]]
There are problems with the placeholders [+ previous +] [+ pages +] [+ next +] when calling:
<p>[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`engilish`]]</p>
<p>Showing [+start+] - [+stop+] of [+total+] Articles</p>
<p>Pages.: [+previous+] [+pages+] [+next+]</p>
Example:[+next+] = http://example.com/news?yams_lang=en&start=5
Clicking this link will be made to redirect to default language, in my example, the transition will be made http://example.com/news?yams_lang=ru&start=5
Quote from: jonimant at Aug 02, 2009, 07:22 PM
There are problems with the placeholders [+ previous +] [+ pages +] [+ next +] when calling:
<p>[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`engilish`]]</p>
<p>Showing [+start+] - [+stop+] of [+total+] Articles</p>
<p>Pages.: [+previous+] [+pages+] [+next+]</p>
Example:[+next+] = http://example.com/news?yams_lang=en&start=5
Clicking this link will be made to redirect to default language, in my example, the transition will be made http://example.com/news?yams_lang=ru&start=5
I have managed to reproduce the problem. I am not surprised that these ditto placeholders don’t work, since ditto and its extenders know nothing about YAMS and multilingual URLs. It surprises me therefore, that I see yams_lang=en in the URL - since that comes from YAMS somehow, and URLs of this form are normally only output in query param mode, but YAMS is not in that mode. So, there might be a YAMS bug somewhere.
I am going to have to look into the paginate or summarise (or whatever it is called) ditto extender to see what it is doing. In the worst case scenario (and this is quite likely) it might be necessary to create a YAMS version of the extender that will output YAMS compatible URLs. Please leave it with me and I will investigate what needs to be done. I can’t promise that I will be able to come up with an immediate solution because quite a bit of work might be involved.
Can you avoid using ditto placeholders for the time being?
[!Ditto? &id=`(yams_id)` &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateSource=`editedon` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`(yams_mname)` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`!] <p>Showing [+(yams_id)_start+] - [+(yams_id)_stop+] of [+(yams_id)_total+] Articles</p> <p>Pages.: [+(yams_id)_previous+] [+(yams_id)_pages+] [+(yams_id)_next+]</p>
Hi again jonimant
Thanks for sending me a PM with a login to your site. I’m really impressed with your site and the extent to which you have used YAMS already! Here are a couple of general hints/pointers:
1. I noticed that you use ’Default’ as your redirection mode. That means that anyone browsing to http://www.mysite.com/ will automatically be redirected to your default language, which is Russian. In your case that will be http://www.mysite.com/ru/
You might like to set it to ’Browser’. In that case people will be redirected to a language page that matches their browser settings if possible. So, I would automatically be redirected to the English root. http://www.mysite.com/en/
2. I noticed that you use code like this:
[[YAMS? &get=`content` &from=`content` &docid=`[*id*]`]]
to get the content field in the correct language for the current page within your document template. That’s fine, but YAMS is actually intelligent enough to understand normal MODx document variables. So you could have just used
[*content*]
like in normal MODx templates. If you use the latest version of YAMS from my server, version 1.0.3 alpha RC3 then you hardly have to modify your document templates at all, since even URLs are handled automatically.
thanks did not know. that it works
3. I noticed that your normal document variables are still visible when editing your multilingual documents. However, these are redundant for multilingual templates, since you have multilingual variants on the other tabs. Once you have finished translation you can hide the redundant ones by selecting the Hide Redundant Fields option on the Other Params tab.
4. I noticed that in your ditto templates you are using code like
[[YAMS? &get=`content` &docid=`[+id+]` &from=`pagetitle`]]
to get the pagetitle of the current page being read by ditto.
While that is a general method that will work with any template, there is an easier ay with ditto. If you use the ditto extender that I have written then you can use a normal ditto placeholders instead. So in this case you would just write
[+pagetitle+]
like normal.
To use the ditto extender, just add &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` to your snippet call as mentioned previously.
does not work, it displays an error: @FILE:assets/modules/yams/yams.extender.inc.php extender does not exist. Please check it.
Now to the real issues:
Quote from: PMS at Aug 03, 2009, 04:14 AMI just checked this out and it worked for me. I took a look at your site and I noticed that you only had one dittocall chunk. Actually you need one for each language like so
Quote from: jonimant at Aug 02, 2009, 07:22 PMI’ll investigate this tonight and get back to you. (About 8 hours from now for me.)
Chunk call from [[YAMS? &get=`chunk` &from=`dittocall`]] did not help.
No results.
dittocall_en:[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`english` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`]]
dittocall_ru:[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`russian-UTF8` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`]]
etc.
Then the snippet call [[YAMS? &get=`chunk` &from=`dittocall`]] should work.
Quote from: jonimant at Aug 02, 2009, 07:22 PM
There are problems with the placeholders [+ previous +] [+ pages +] [+ next +] when calling:
<p>[[Ditto? &tpl=`news` &sortBy=`createdon` &summarize=`5` &dateFormat=`%d.%m.%Y` &truncText=`>>` &paginate=1 &language=`engilish`]]</p>
<p>Showing [+start+] - [+stop+] of [+total+] Articles</p>
<p>Pages.: [+previous+] [+pages+] [+next+]</p>
Example:[+next+] = http://example.com/news?yams_lang=en&start=5
Clicking this link will be made to redirect to default language, in my example, the transition will be made http://example.com/news?yams_lang=ru&start=5
I have managed to reproduce the problem. I am not surprised that these ditto placeholders don’t work, since ditto and its extenders know nothing about YAMS and multilingual URLs. It surprises me therefore, that I see yams_lang=en in the URL - since that comes from YAMS somehow, and URLs of this form are normally only output in query param mode, but YAMS is not in that mode. So, there might be a YAMS bug somewhere.
I am going to have to look into the paginate or summarise (or whatever it is called) ditto extender to see what it is doing. In the worst case scenario (and this is quite likely) it might be necessary to create a YAMS version of the extender that will output YAMS compatible URLs. Please leave it with me and I will investigate what needs to be done. I can’t promise that I will be able to come up with an immediate solution because quite a bit of work might be involved.
Can you avoid using ditto placeholders for the time being?
Finally, would you mind if I publicise your site and the fact that it uses YAMS by adding it to the table on the first post of this thread?