YAMS - MODX Community Forums https://forums.modx.com/board/?board=84 <![CDATA[Too many redirects]]> https://forums.modx.com/thread/104256/too-many-redirects?page=2#dis-post-560786
Fresh install, new website. MODX 1.4.5 - YAMS 1.2.0 RC7

When I go to the first page http://sub.domain.com/ -> redirect to http://sub.domain.com/fr/home.html -> redirect to http://sub.domain.com/ -> etc. (no ending)

If I go to an secondary page: http://sub.domain.com/presentation.html -> redirect to http://sub.domain.com/http://sub.domain.com/fr/presentation.html and display the default page (not the presentation.html).

Yes, http://sub.domain.com twice !!!!

My .htaccess file
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /

# Fix Apache internal dummy connections from breaking [(site_url)] cache
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]

# Exclude /assets and /manager directories and images from rewrite rules
RewriteRule ^(manager|assets|js|css|images|img)/.*$ - [L]
RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]

# Redirect from mydomain.com/rootname to mydomain.com/rootname/
RewriteRule ^en$ en/ [R=301,L]
RewriteRule ^fr$ fr/ [R=301,L]
RewriteRule ^de$ de/ [R=301,L]

# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^de/(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

I don't understand.

Heeeelp !]]>
https://forums.modx.com/thread/104256/too-many-redirects?page=2#dis-post-560786 Wed, 15 Aug 2018 01:02:02 +0000 https://forums.modx.com/thread/104256/too-many-redirects?page=2#dis-post-560786
<![CDATA[YAMS refuses associating language TVs with template]]> https://forums.modx.com/thread/97723/yams-refuses-associating-language-tvs-with-template#dis-post-556915
Failed to associate template variable content_fr" with template number 3 .
Failed to associate template variable content_de" with template number 3 .
Failed to associate template variable content_en" with template number 3 .


Which could be the cause of such errors, which occur when trying to switch a template to multilingual (in "Modules > YAMS > Multilingual templates")?

I checked that the TVs for languages are available for the given template (which has id=3 in the templates table).
YAMS language tabs are displayed, but empty, as the multilingual TV remain on the "General" tab.

Thanks for your help.


  • MODx 1.0.15
  • Content of tables coming from a working multilingual MODx 1.0.3 site.
https://forums.modx.com/thread/97723/yams-refuses-associating-language-tvs-with-template#dis-post-556915 Sun, 18 Feb 2018 06:26:01 +0000 https://forums.modx.com/thread/97723/yams-refuses-associating-language-tvs-with-template#dis-post-556915
<![CDATA[YAMS language tabs first? (YAMS language tabs before "General" & "Page settings" tabs?)]]> https://forums.modx.com/thread/102979/yams-language-tabs-first-yams-language-tabs-before-general-page-settings-tabs#dis-post-554537
When using YAMS with ManagerManager, is there a trick to place the language tabs BEFORE the usual MODx document tabs?

Second question: is is possible to directly enter into "Create/Edit Ressource" mode when clicking a node in the tree? (I had this working before using ManagerManager+YAMS.)

https://forums.modx.com/thread/102979/yams-language-tabs-first-yams-language-tabs-before-general-page-settings-tabs#dis-post-554537 Mon, 16 Oct 2017 09:43:12 +0000 https://forums.modx.com/thread/102979/yams-language-tabs-first-yams-language-tabs-before-general-page-settings-tabs#dis-post-554537
<![CDATA[ [Solved] YAMS not displaying language tabs]]> https://forums.modx.com/thread/102828/solved-yams-not-displaying-language-tabs#dis-post-554395
I tried to copy YAMS to another website on localhost but language tabs don't display, everything seems same. I missed something, but what ?

Solution: the mm_rules chunk was missing. (see 4th post below about how to set it)

Here's what I have done:
- copy of the assets/modules/yams folder
- adapted yams.config.inc.php and .htaccess for the new website
- created the multilingual TVs
- installed the YAMS module, created multilingual variables, set multilingual templates
- set the YAMS plugin and associated the following events:
Template Service Events

Template Service Events

Cache Service Events



As I was not sure if required, I also installed ManagerManager and configured it like for the other site.

It seems from the "Server Config" tab of the YAMS module, that the server config is not content of the .htaccess at the root of the site, like if some version had been cached.

Any idea?]]>
https://forums.modx.com/thread/102828/solved-yams-not-displaying-language-tabs#dis-post-554395 Mon, 09 Oct 2017 10:58:41 +0000 https://forums.modx.com/thread/102828/solved-yams-not-displaying-language-tabs#dis-post-554395
<![CDATA[ [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-539846
1. Create chunk AS_Result, where we need to change page title
from AjaxSearch type ( [+as.pagetitle+] )
to YAMS type ( [[YAMS? &get=`content` &from=`longtitle` &docid=`[+as.id+]`]] )

<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[[YAMS? &get=`content` &from=`longtitle` &docid=`[+as.id+]`]]</a>
  <span class="[+as.descriptionClass+]">[+as.description+]</span>
  <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
  <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>

2. Create search form with search in specified TV’s according to chosen language. The landing page in this example is 50.

[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`50` &AS_showResults=`0` &withTvs=`+:content_(yams_id),description_(yams_id),introtext_en,longtitle_(yams_id),menutitle_(yams_id),pagetitle_(yams_id)` &language=`(yams_mname)`!]

Nota bene! We have to use &ajaxSearch=`0` because there is incorrect page title displaying in ajax mode takes place. This is due to ajaxResult.tpl template in ajax mode is rendered bypassing YAMS.

3. Create landing page (in our example 50) within another AjaxSearch call:

[!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &AS_showResults=`1` &tplResult=`AS_Result` &language=`(yams_mname)`!]

4. Change redirection type in Modules → YAMS → Other Params → URL Redirection Settings → Redirection Mode to “Current else Browser” for correct redirection to pages searched.

So it works now. This solution has limitations in ajax mode, and can produce some mistakes in search results, but enough correct for use.

With tanks to PMS for help.]]>
https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-539846 Tue, 22 Mar 2016 06:44:48 +0000 https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-539846
<![CDATA[ [Evo] YAMS or another approach?]]> https://forums.modx.com/thread/45613/evo-yams-or-another-approach?page=2#dis-post-539102
I see this thread
and this tutorial
as well as YAMS.

Can anyone working with these suggest which might be a better solution? A stop-gap approach has been to use a Google Translate dropdown (which, frankly, works well enough for someone to get the gist of what’s going on a page). But there is a thought that for a handful of languages contributors would want to override/replace such a naive translation with something more accurate. Then there’s the whole issue of getting the current content replicated in a different language to start off. But if there’s a way of programmatically invoking Google’s Translate to generate the raw material, this can be dealt with.

Anyway, thanks in advance for any thoughts.
https://forums.modx.com/thread/45613/evo-yams-or-another-approach?page=2#dis-post-539102 Wed, 02 Mar 2016 11:07:23 +0000 https://forums.modx.com/thread/45613/evo-yams-or-another-approach?page=2#dis-post-539102
<![CDATA[Using @CODE: with YAMS flags]]> https://forums.modx.com/thread/99665/using-code-with-yams-flags#dis-post-539099 Noticed @CODE: doesn't work when trying to get the language flags:

This works:

But this below only shows the current lang:

&repeattpl=`@CODE:<a href="(yams_docr)">(yams_id)</a>` 
&currenttpl=`@CODE:<span class="active">(yams_id)</span>`

I normally never used @CODE: so could be I can't use it for some reason.
https://forums.modx.com/thread/99665/using-code-with-yams-flags#dis-post-539099 Wed, 02 Mar 2016 10:48:54 +0000 https://forums.modx.com/thread/99665/using-code-with-yams-flags#dis-post-539099
<![CDATA[YAMS 'The server refused the connection yams' problem on MODx Evo]]> https://forums.modx.com/thread/99584/yams-the-server-refused-the-connection-yams-problem-on-modx-evo#dis-post-538508
I've just installed YAMS from this https://rtfm.modx.com/extras/evo/yams/yams-english-documentation/yams-installation tutorial, and now after clicked any button on this page:

I can see only 'The server refused the connection yams']]>
https://forums.modx.com/thread/99584/yams-the-server-refused-the-connection-yams-problem-on-modx-evo#dis-post-538508 Fri, 19 Feb 2016 03:02:42 +0000 https://forums.modx.com/thread/99584/yams-the-server-refused-the-connection-yams-problem-on-modx-evo#dis-post-538508
<![CDATA[ [+content:notags:limit="250"+] doesnt work]]> https://forums.modx.com/thread/71715/content-notags-limit-250-doesnt-work#dis-post-538294 https://forums.modx.com/thread/71715/content-notags-limit-250-doesnt-work#dis-post-538294 Sun, 14 Feb 2016 03:21:13 +0000 https://forums.modx.com/thread/71715/content-notags-limit-250-doesnt-work#dis-post-538294 <![CDATA[YAMS limiting content area in multilingual teplates]]> https://forums.modx.com/thread/98795/yams-limiting-content-area-in-multilingual-teplates#dis-post-534334
I have came across a very weird issue when using YAMS. So I have set up everything according to YAMS Documentation and recommendations and everything works great so far. However I have noticed that if you try to put a lot of content in the content section of a multilingual template, it does not save the whole text but cuts it out on certain point. In my case I have a doc file which contains 7201 words and when I try to put all that content in my content section of my desired resource, modx custs out the content somewhere around 5366 words or 246 lines of html (if I am looking at the source of the content area). If try to put the same content in a monolingual template (which does not use YAMS) everything works as expected. The same happens if I put the content in the content area of the General Tab in my resource.
Do someone have an idea what might causing this content limitation and eventually how to fix it?

I am using shared hosting and Modx Evo 1.0.15 version and the version of YAMS is 1.1.9.

Thanks in advance!

Best Regards!]]>
https://forums.modx.com/thread/98795/yams-limiting-content-area-in-multilingual-teplates#dis-post-534334 Fri, 13 Nov 2015 01:23:47 +0000 https://forums.modx.com/thread/98795/yams-limiting-content-area-in-multilingual-teplates#dis-post-534334
<![CDATA[YAMS and redirecting agecheck doesn't work.]]> https://forums.modx.com/thread/98700/yams-and-redirecting-agecheck-doesn-t-work#dis-post-533760 The agecheck looks if there is a cookie, if yes then go to the homepage, if not go to the agecheck page.
When the agecheck is correct the NL homepage is loaded nomatter which language I came from.
I need it to redirect to the EN homepage after filling the EN agecheck..

Agecheck id: 1
Home id: 12
Logincheck is: 13

I use YAMS and default language is NL

All pages has this script:

if(!$.cookie("date") && [*id*] != 1) {

After the form is filled I go to ID 13. This works correct. When starting on the EN page I go to the EN logincheck page.
On that page there is a snippetcall:

[!loginchecker? &redirectTo=`12`!]

The snippet looks like:
if (isset($_COOKIE['date'])){
// here some code…
$url = $modx->makeUrl($redirectTo);
if ($refUrl != '') {
$url = $refUrl;
return $modx->sendRedirect($url);
$url = $modx->makeUrl(1);
return $modx->sendRedirect($url);

I have looked for solutions but I don´t understand it that great.
Didn´t made the agecheck.

All I found are these posts but I don't know how to fix it.

Is there someone who knows what to do?
https://forums.modx.com/thread/98700/yams-and-redirecting-agecheck-doesn-t-work#dis-post-533760 Wed, 28 Oct 2015 03:38:09 +0000 https://forums.modx.com/thread/98700/yams-and-redirecting-agecheck-doesn-t-work#dis-post-533760
<![CDATA[YAMS [DITTO, CHUNK & TV] !]]> https://forums.modx.com/thread/45610/yams-ditto-chunk-tv#dis-post-532886
i have a little problem with calling multilingual TV’s.

i explain :

i have a page based on a modele called INDEX.
in the modele, i call the content with : [*content*]

in the page based on this modele, in the content area, i have a DITTO call, as follow (it’s in the FRENCH tab):
this ditto calls the children pages.

[[Ditto?extenders=`@FILE assets/modules/yams/yams.extender.inc.php`&parents=`1`&depth=`1`&tpl=`home` &noResults=` ` &orderBy=`menuindex ASC`]]

here is the chunk HOME:

<div id="titre-accueil">[+titre-accueil+]</div>
<div id="main-2col-gauche-collec"><img src="[+image-news+]" width="280" height="210" align="center"/></div>
<div id="main-2col-droite-collec">[+content+]</div>
<p class="clear"></p>

the problem is that my TV Titre-accueil isn’t displayed on my page.

where do i have to specify the language settings ?

thanks for your answer !

https://forums.modx.com/thread/45610/yams-ditto-chunk-tv#dis-post-532886 Wed, 07 Oct 2015 01:59:46 +0000 https://forums.modx.com/thread/45610/yams-ditto-chunk-tv#dis-post-532886
<![CDATA[Chrome refused to load site: (net::ERR_TOO_MANY_REDIRECTS)]]> https://forums.modx.com/thread/45622/chrome-refused-to-load-site-net-err-too-many-redirects#dis-post-532542
I’m using MODX 1.0.5 Evolution, in combination with YAMS 1.2.0 RC3. I’ve used the .htaccess which is generated with this version. The site works fine in every browser except Chrome! The browser takes a while with loading the homepage and all it does in the end is give me a Chrome error page, which contains the following message:

Error 310 (net::ERR_TOO_MANY_REDIRECTS): there are too many redirects 

I’ve installed YAMS 1.2.0 RC3 and it has something to do with it. I’ve disabled the plugin and it works fine then. Can someone help me out here please? I’m using the .htaccess that is generated with the settings. Settings are included in a PNG file attached to this post.

Thanks a lot in advance!]]>
https://forums.modx.com/thread/45622/chrome-refused-to-load-site-net-err-too-many-redirects#dis-post-532542 Thu, 01 Oct 2015 02:39:39 +0000 https://forums.modx.com/thread/45622/chrome-refused-to-load-site-net-err-too-many-redirects#dis-post-532542
<![CDATA[Is there a way to hide MODx default fields in YAMS tabs ?]]> https://forums.modx.com/thread/98384/is-there-a-way-to-hide-modx-default-fields-in-yams-tabs#dis-post-532039
I'm using YAMS to store short multilingual news (which I plan to concatenate with Ditto).

The news basically use the "pagetitle" and the "content" fields.
They don't need, "longtitle", "description", "introtext" nor "menutitle".

Currently, the YAMS tabs display "longtitle_xy", "description_xy", ...,
where "xy" is the language code. Is there a way to avoid this when the page use the "news" template?

In yams.mm_rules.inc.php, I found the code below, but it doesn't seem hiding fields for multilingual templates.
Should I edit $activeTemplateList manually, and possibly edit mm_hideFields too?
  if ( $hideFields )
    // Don't hide the pagetitle because it is used within the modx document tree
    // to identify the page
      , ''
      , $activeTemplateList

Thank your for your help.]]>
https://forums.modx.com/thread/98384/is-there-a-way-to-hide-modx-default-fields-in-yams-tabs#dis-post-532039 Tue, 22 Sep 2015 12:28:55 +0000 https://forums.modx.com/thread/98384/is-there-a-way-to-hide-modx-default-fields-in-yams-tabs#dis-post-532039
<![CDATA[Integrating YAMS with Easy 2 Gallery]]> https://forums.modx.com/thread/45564/integrating-yams-with-easy-2-gallery?page=2#dis-post-530219
Recently, someone asked me about multilangual ability in Easy 2 Gallery.
The first thought in my mind was about integrating the YAMS and E2G.
One thing you should realized is that E2G does not have any relation to the document parsing data, while YAMS runs on it.
E2G’s snippet retrieves all data from its own database.

I’ve dug the YAMS’s code, and it seems that all the language configurations are stored inside the yams.config.inc.php, which is called by the yams.class.inc.php (Initialise() function).

I do not need more field in YAMS’s module.
What I’d like to ask is that will you get YAMS provides some CONSTANT values, so when E2G sniffs:

then the E2G’s snippet will make the language conversion itself.
If you don’t mind to do that, then it will be easier for snippets like E2G to integrate the language selection trigger.

From what I can feel right now, the priority constants are (the names are only to desribe my thought):

  • ..._LANGS_LIST

If you can provide these, then I can set E2G’s module to have more language fields according to that options.

What do you think?]]>
https://forums.modx.com/thread/45564/integrating-yams-with-easy-2-gallery?page=2#dis-post-530219 Wed, 19 Aug 2015 08:00:57 +0000 https://forums.modx.com/thread/45564/integrating-yams-with-easy-2-gallery?page=2#dis-post-530219
<![CDATA[parse error array_key_exists()]]> https://forums.modx.com/thread/98024/parse-error-array-key-exists#dis-post-530102
I installed YAMS 1.1.9 on my MODX 1.0.9, when running any page got error like above.
Tried Github version too https://github.com/goldsky/YAMS - the same error.
PHP Version 5.2.17

« PHP Parse Error »
PHP error debug
Error :	array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object
ErrorType[num] :	WARNING[2]
File :	/home/users/.../public_html/.../assets/modules/yams/class/yams.class.inc.php
Line :	799
Source :	if ( array_key_exists( $qp, $_GET ) )
https://forums.modx.com/thread/98024/parse-error-array-key-exists#dis-post-530102 Sun, 16 Aug 2015 11:36:07 +0000 https://forums.modx.com/thread/98024/parse-error-array-key-exists#dis-post-530102
<![CDATA[About YAMS (Yet Another Multilingual Solution) + Latest News]]> https://forums.modx.com/thread/45431/about-yams-yet-another-multilingual-solution-latest-news?page=3#dis-post-522924 YAMS: Yet Another Multilingual Solution for MODx Evolution and earlier versions.

YAMS is a highly configurable multilingual solution that doesn’t require the user to maintain multiple document trees and which allows the user to work with existing document templates.

YAMS 1.1.9 is the latest official stable release and is available from the MODx repository.

This release fixes several bugs in YAMS 1.1.7 alpha RC7 and YAMS 1.1.8. It includes multilingual alias and SEO Strict style functionality. There are still some known bugs yet to be fixed.

The latest release candidate is YAMS 1.2.0 RC3 and fixes a bug which would cause the [tt][[YAMS? &get=`data` ... ]][/tt] snippet call to incorrectly output content obtained from monolingual documents.

YAMS has been developed on MODx Evolution v0.9.6.3 and with the latest version of PHP (>=5.2.9). I haven’t made any effort as yet to make it backwards compatible with older versions of either. YAMS will not work with PHP 4 since it makes use of PHP 5 classes. It has been tested on MODx Evolution v0.9.6.3 up to v1.0.3.


Version 1.1.9
- Bug Fix: Fixed a bug introduced at version 1.1.8, which breaks ((yams_data:..))
- Bug Fix: Applied kongo09’s patch, which fixes a bug whereby default content is
not copied over to new fields when multilingual tvs are associated with new templates.

Version 1.1.8
- Updated YAMS ManagerManager rules so that when hide fields is on, multilingual aliases are hidden when multilingual aliases are switched off and the standard document alias is hidden when multilingual aliases are switched on.
- Updated the documentation for Hide Fields accordingly.
- Bug Fix: Fixed a <p> that should have been a </p> in the module
- Updated the forum link to http://modxcms.com/forums/index.php/board,381.0.html
- Added a title field to the YAMS ditto extender. This outputs the page title.
- Bug Fix: Corrected a typo str2lower -> strtolower.
This bug fix is necessary for YAMS to work over HTTPS.
Reported by noes: http://modxcms.com/forums/index.php/topic,42752.0.html
- Added an additional check to prevent crashing if $modx->documentObject doesn’t exist.
- Made the Expand function public.
- Bug Fix: Fixed a bug whereby the current language would be lost when changing page using ditto pagination and unique multilingual aliases.
- Bug Fix: Corrected a problem with switching languages when using unique multilingual aliases.
- Improved installation instructions.
- Bug Fix: Fixed a bug whereby YAMS ManagerManager rules would be applied to all (rather than no) templates when no multilingual templates are specified.
- Documentation updates

Version 1.1.7 alpha RC7
- Included @French Fries’ Wayfinder breadcrumbs templates and updated the How To?
- Included an option to turn off automatic redirection to the correct multilingual
URL when standard MODx style URLs are encountered for specified document ids.
- Bug fix: MODx default behaviour is that when a document not assigned any alias
it is instead referred to by its id. This wasn’t implemented. Done now, except
that for multilingual documents with unique aliases on, the documents are
referred to by langId-docId.
- Removed a system event log command that was added for debugging purposes but
accidentally left in the code.

Version 1.1.7 alpha RC6
- Most of the languageicons have been removed from the distribution. The full
set can be downloaded from http://www.languageicon.org/
- Removed the ’do you want to allow YAMS to manager multilingual variables’ option
from the multilingual templates tab.
- Tweaks to the module interface to make it easier to to find submit buttons.
- Removed some unneeded checks in frequently executed code for efficiency
- Bug Fix: Fixed a couple of errors whereby YAMS was trying to access a regexp
match that was undefined (rather than empty)
- Bug Fix: Fixed an error that could potentially result in YAMS not correctly
identifying an HTTPS connection.
- Efficiency improvements.
1) YAMS removes empty constructs instead of processing them.
2) When loading monolingual documents, now only the default language variant is
parsed. Previously all language variants were parsed but only one was served.
Monolingual documents will be served approx 1/n times faster, where n is the
number of languages.
3) As soon as a document is loaded from cache YAMS now strips out superfluous
language variants. Previously it evaluated all language variants but served
just one. For documents with a lot of uncachable content this can lead to an
improvement in speed of approx 1/n, where n is the number of languages.
- Bug Fix: Updated the managermanager rules to fix a bug whereby if more than one
custom tv was assigned to a language, only the last would be tabified.

Version 1.1.7 alpha RC5
- Bug fix: Fixed a bug whereby on first save of a newly created multilingual
document, pagetitles and aliases would not get updated.
- Bug fix: Fixed an URL encoding issue. The php header function accepts
a plain text URL, but YAMS was passing it an HTML encoded URL.
- Bug fix: The new multilingual URL capability had broken query parameter mode
and non-friendly URLs. Fixed.

Version 1.1.7 alpha RC4
- Now, if YAMS doesn’t recognise an URL as being valid, but MODx does, then YAMS
will redirect from the MODx recognised URL to the correct URL using the status
codes defined on the ’Other Params’ tab, rather than generating 404 not found.
(This aids compatibility with existing MODx resources that don’t understand
multilingual URLs and is what YAMS used to do in previous versions before I broke

Version 1.1.7 alpha RC3
- Bug fix: Corrected an .htaccess bug.

Version 1.1.7 alpha RC2
- Bug fix: Corrected a small URL encoding bug.
- Included an option to make MODx stripAlias optional for multilingual aliases.
- YAMS now does automatic updating of aliases, checking for unique aliases and
checking for duplicate aliases.
- Updated the YAMS managermanager rules so that they work with the latest version
of managermanager (0.3.4), which refers to tvs by name instead of id like MODx.
YAMS should be backwards compatible with older versions of both mm and MODx.
- Bug fix: Corrected a dodgy regexp which was causing URL resolution problems
when installing into a subdirectory.
- Updated the friendly URL config to include standard MODx stuff (avoids
confusion about whether it should be there or not)
- Updated the root name trailing slash redirection to be consistent with apache
- stripAlias is now implemented for multilingual URLs. Need to check that it
works on pre-Evo installs.
- stripAlias can result in empty aliases. Need to handle that.
- Implemented automatic pagetitle update
- Implemented better document pagetitle synchronisation
- Started implementing automatic alias updating.
- Bug fix: YAMS could return HTTP OK for monolingual documents with an extra
root name prefix. Fixed. Now permanent redirects to correct monolingual URL.
- Implemented mime dependent aliases. Currently not possible to set the
mime-alias map via the module interface.
- Modified the YAMS to encode tv names in the same way that MODx does for and earlier versions. (Previously the encoding was not done in
completely the same way.)
- Altered the PreParse method to prevent the recursion limit from being reached
on complicated documents. It now returns a flag that says whether it needs to
be called again.
- Tidied up the comments in the code a bit.
- Bug fix: Corrected a missing variable declaration in yams.module.inc.php

Version 1.1.7 alpha RC1
- Bug fix: Corrected (I hope) and URL bug which would affect documents nested
at level 2 and greater when using friendly alias paths.

Version 1.1.6 alpha
- Added SEO Strict style URL functionality. YAMS will now permanent redirect
to the correct URL when
* slashes are incorrectly specified (multiple slashes or missing trailing slash)
* the prefix and suffix of a filename are missed
* the prefix and suffix are included for a folder
In addition, there is now a new option that allows the re-writing of containers
as folders: .../mycontainer.html -> .../mycontainer/
Currently there is no facility for overriding this on a document by document
- Introduced a new redirection mode: "current else browser". When redirecting to
a multilingual page, if the site has been visited previously and a language
cookie has been saved, the visitor will be redirected to a page in that language.
Otherwise they will be redirected to a page based on their browser settings.

Version 1.1.6 alpha RC1
- Bug Fix: Fixed a problem whereby documents could break when loading them from
the cache.
- Bug Fix: Fixed a server config bug affecting rootname to rootname/ redirection.
- Bug Fix: Repaired a missing space in a mysql query.

Version 1.1.5 alpha
- Bug Fix: Fixed a parse bug which could occasionally involve a regular
expression grabbing too much and breaking YAMS constructs.

Version 1.1.5 alpha RC3:
- Bug Fix: Corrected a bug in breadcrumbs.101.yams.snippet.php
- Made use of the new ((yams_data:...)) construct to optimise
breadcrumbs.101.yams.snippet.php by minimising database queries.
- Renamed breadcrumbs.101.yams.snippet.php to give it the php extension.
Also included code to protect it against direct execution.
- PreParseOptimise is fairly resource intensive, so only call it if
pre-parse-optimisation is really required (that is, if there is more than one
nested yams-select construct.)
- yams_doc and yams_docr were really inefficient, because each document alias
was requiring at least one database query. Now use a cache which stores the alias
of each document in each language, as well as its parent. This can bring result
in major performance enhancements
- Updated the server config to include redirection from mysite.com/root to
- Bug Fix: Made sure yams-in blocks get parsed on the final PostParse call. As a
result of this fix Ditto will no longer complain that it can’t find the language
file when using &language=`(yams_mname)`
- It is not necessary for PostParse to be called recursively. Fixed.
- YAMS was executing on the OnWebPageComplete event... but this was completely
unnecessary. Fixed.
- Bug Fix: Fixed misplaced PostParse argument.
- Bug Fix: Corrected a bug which would cause the current language block of a
repeat construct to be output as blank when no currentTpl was specified. (In
this case, the repeatTpl should be used.)
- Updated the StoreYamsInCallback and StoreYamsRepeatCallback to use a new
YamsCounter number rather than using the number of the block being cached.

Version 1.1.5 alpha RC2:
- Bug Fix: Corrected another URL encoding bug that would prevent incorrect
changing of language and which sometimes gave rise to blank pages.

Version 1.1.5 alpha RC1:
- Bug Fix: Corrected an URL encoding bug that would prevent incorrect changing
of language.
- Updated the Wayfinder and Ditto extensions to use [[YAMS? &get=`data`.
- Updated the manager manager rules to ensure that the template variables are
moved to tabs in the correct order. Wasn’t sure if the existing array_merge
was simply concatenating the sorted arrays.
- Updated the YAMS snippet cal to make use of the ((yams_data:... syntax.
[[YAMS? &get=`content` is now depracated and [[YAMS? &get=`data` should be
used in its place
- First implementation of the ((yams_data:docId:tvname:phx)) syntax for improved
performace through minimisation of the number of sql queries. Does not
support PHx yet. Loads data from a maximum of YAMS_DOC_LIMIT documents at time.
- Bug Fix: Fixed several bugs introduced when updating the parsing. YAMS
placeholders can now go almost anywhere.
- Fairly major changes to parsing:
- YAMS now ensures that all chunks and tvs - which may contain YAMS placholders
- are parsed on the PreParse step before handing over to MODx.
- It should now be possible to include yams placeholders in cacheable AND
uncacheable snippet calls and in chunk and tv names...
- Updated documentation to describe multilingual alias modes in more detail.
- Modified to allow the monolingual URL and (one of) the multilingual URLs
to coincide. Now, when unique multilingual aliases are not being used it
is only necessary for the multilingual language variants to be unique.
- Bug Fix: Fixed a bug whereby tv’s would be incorrectly sorted in the document
- Included a How TO? for custom multilingual tvs/chunks/snippets.
- Updated the multilingual URL generation and checking so as to exclude deleted
- Bug Fix: Corrected a bug whereby YAMS would not change language when on the
site start document.

Version 1.1.4 alpha:
- Bug Fix: Corrected the Wayfinder How To? module documentation.
- Implemented automatic redirection of weblinks. This wasn’t implemented before.
This works with multilingual weblinks too. In the content fields of a
multilingual weblink it is possible to specify the same or different URLs or
docIds for each language. When using a docId, the target document will be
displayed in the same language as the source document, or the default language
if the final document is monolingual.
- Made the $yams->ConstructURL( $langId, $docId ) method public so that it can
be used as a replacement for $modx->makeUrl( $docId ) when YAMSifying existing
snippets etc.
- Bug Fix: Correct a bug in the implementation of friendly url suffixes and prefixes.
This bug made the suffixes and prefixes active at every level instead of just
the filename.
- Bug Fix: Updated the server config. It now displays the correct output when
unique multilingual aliases only are being used. It also advises on virtual
host configuration when server name mode is being used.
- Corrected a potential bug whereby the second argument of preg_quote was not
- Reorganised the params on the ’Other Params’ tab and updated the multilingual
alias text a bit.

Version 1.1.3 alpha:
- Added support for friendly alias prefixes and friendly alias suffixes.
- Bug Fix: Corrected server config bug. ${...} should have been %{...}
- Added support for phx modifiers on multilingual document variables. The
following are examples of accepted syntax:
- Replaced YAMS’ own recursive chunk parsing call an iterative call to
MODx’s mergeChunkContent. Seemed silly not to reuse existing code.
- Now YAMS maintains a list of monolingual document ids, to avoid having to
look up whether a document is multilingual in the database each time.
- Bug Fix: Fixed a bug in the server config. Was using the output query param
separator instead of the input one. As a result was getting double encoded
- Modified the default output query separator (used when it is not defined by
PHP) to be &amp; rather than &.
- Bug Fix: Fixed problem whereby invalid monolingual URLs which are invalid due
to a multilingual servername being used would redirected to themselves.
- Bug Fix: Fixed a bug whereby the alias of the site-start document was being
included in the URL when using friendly alias paths and when it shouldn’t have
been because of a YAMS setting.
- Sort of bug fix: I have removed the mb_strtolower function from the URL
comparison since mbstring library is not active by default in PHP. Was going
to replace it by strtolower - which would have been safe on the encoded URL.
However, since MODx does not support case insensitive URLs anyway - so I have
removed it. True support for case insensitive URLs would be possible but would
require a bit more thought.
- Bug Fix: Fixed bug active when friendly alias paths is on which was causing
docs lower than the root to not be found.

Version 1.1.2 alpha:
- Now possible to view document using index.php?id=... So, preview from the document
tree now works again.
- Fixed a bug wherby callbacks were being registered statically when they shouldn’t
have been.

Version 1.1.1 alpha:
- Modified the default multilingual URLs generated by YAMS so that the alias
of the default language variant is the same as that of the document variable.
- Implemented a ’Unique Multilingual Aliases’ mode. This mode is activated if
unique multilingual aliases are being used. In that case it is not
necessary to specify root names or server names. YAMS can determine the language
group id and document id directly from the alias. The documentation needs
updating now.
- Improved commenting of the code a little.
- Applied proper URL encoding to the subdirectory and root name.

Version 1.1.0 alpha:
- Generalised generated query strings to use the php defined argument separator
- Added a parameter for specifying whether aliases are unique or not.
- Updated the copying over of default content for multilingual aliases.
- Now does proper encoding of URLs. Multibyte URLs are correctly encoded.
- Added correct conversion from native encoding to utf-8 to rawurlencoded and
back again for URLs and query parameters.
- Added methods for escaping and cleaning strings for embedding in (x)html/xml
documents and updated all occurrences of htmlspecialchars to use them.
- Arranged it so that the current language cookie is only set if a valid document
is found and it is multilingual.
- If a multilingual alias has not been specified, then nothing is output for the
- Incorporated mbowman’s YAMS_UX code into YAMS.
* Generalised it to function with and without friendly alias paths.
* Generalised it to function with or without multilingual alias mode
* Generalised it to take into account absent filename for site start (only
default language if using multilingual aliases).
* Fixed incorrect langId specification.
- YAMS now manages the alias document variable associated with multilingual
- Default descriptions for Multilingual TVs created by YAMS are now in the correct
- YAMS now manages a list of supported document variable types.
- Allowed (*.)localhost as a valid server name


YAMS allows users to define language groups and specify certain templates as multilingual. All documents associated with those templates are then accessible in multiple languages via different URLs. The different language versions can be distinguished by root folder name, by server name, by a query parameter, or if you are using the alpha version, by alias. Unlike other multilingual solutions, it is NOT necessary to manage multiple document trees with YAMS. Instead, all content for all languages is stored in template variables in the multilingual documents. YAMS has a ManagerManager extension that will organise the template variables for different languages onto different tabs. (See screenshot below.) YAMS is also capable of creating and managing the multilingual template variables automatically. Whether or not a template is multilingual can be configured simply via the module interface.

Multi-language content for the main document variables (pagetitle, longtitle, description, introtext, menutitle, content) is handled automatically and transparently and is subject to normal MODx caching. No special syntax is required for these document variables. For example, use [*content*] and the correct language content will appear. Standard MODx internal URLs are also automatically converted to multilingual URLs by YAMS.

In addition, YAMS provides a range of placeholders which provide access to the language tag (for use in lang="" or xml:lang=""), the language direction (for use in dir=""), language name and which allow the insertion of multilingual URLs for the current or any other document. These can be used throughout the site, including in snippet templates.

More advanced functionality is available via the YAMS snippet call. For example, via the snippet call it is possible to repeat content over multiple languages using templates. It is also possible to generate language lists or drop-down boxes in order to change language.

Since snippets are generally responsible for parsing the placeholders in templates supplied to them, like [+pagetitle+] for example, they wont automatically know to insert the correct multilingual content. For Ditto this can be overcome through the use of a special extender. For Jot this is overcome through the use of a simple extension. For the templates of other snippets it is possible to overcome this problem by replacing these placeholders by special YAMS snippet calls, eg:
[[YAMS? &get=`data` &from=`pagetitle` &docid=`[+id+]`]]
I have provided YAMS compatible default templates for Wayfinder which already include the appropriate YAMS snippet calls.

As of version 1.0.3, YAMS *should be* fully compatible with EasyLingual. See the Setup tab for instructions on how to migrate a site from EasyLingual to YAMS.

To do or in the pipeline:

  • YAMS+AjaxSearch documentation on the confluence wiki.
  • Allow the setting of a language dependent locale. A call to setlocale could then be made before each snippet call to ensure that locale sensitive functions (like strftime) output the most appropriate content for the given page.
  • Look at alik’s custom filter and use it to create a Ditto filter that will filter out mono or multilingual documents.
  • Investigate the execution of snippets. For any given page request YAMS should only execute the uncacheable snippets of the language that is requested, not the others.
  • Automatic synchronisation of all document variables with the default language tvs (not just pagetitle.)
  • Add option to autogenerate menutitle if blank on doc save.
  • Add How To? documentation for custom templates/chunks/etc.
  • Update YAMS Ditto extender to include support for special ditto placeholders. eg: [+summary+], [+link+], etc.
  • Documentation: Discuss non-UTF8 multibyte support
  • A step by step guide to eForm with YAMS would be useful.
  • Currently YAMS manages the creation, association and disassociation of multilingual template variable versions of the following document variables: pagetitle, longtitle, description, introtext, menutitle, content. The correct language version is then automatically displayed using the standard document variable syntax: [*pagetitle*], etc. If you want to use custom multilingual template variables (eg: keywords_en, keywords_fr,...) these must be created and associated with the multilingual template variables manually, and must be inserted into documents using the [[YAMS? &get=`tv` &from=`keywords`]] snippet call. That’s fine, but I think it would be handy if it was possible to instruct YAMS to manage custom template variables in the same way as it does for the standard ones. This would allow access to the correct language version of that template variable using the standard tv syntax: [*keywords*].
  • Template and document specific language disabling.
  • Make the YAMS module template based and generally tidy up and compartmentalise the code.
  • ... YAMR (Yet Another Multilingual Revolution) ... huh

Good luck!

https://forums.modx.com/thread/45431/about-yams-yet-another-multilingual-solution-latest-news?page=3#dis-post-522924 Wed, 18 Mar 2015 09:46:06 +0000 https://forums.modx.com/thread/45431/about-yams-yet-another-multilingual-solution-latest-news?page=3#dis-post-522924
<![CDATA[YAMS - am i the only one...?]]> https://forums.modx.com/thread/45433/yams---am-i-the-only-one#dis-post-521013 i just registered, i searched a lot but only ever found what i found to be too sophisticated...
am i the only one being convinced that PMS’s YAMS is what you need for a multilingual site but cannot get it to work at all?

my first stumbling block (readme.txt in the zip):
3. Within MODx under Resources>Plugins create a new plugin:

Plugin name: YAMS
Description: <strong>1.0.2 alpha</strong> Yet Another Multilingual Solution Plugin
Plugin code:
require( $modx->config[’base_path’] . ’assets/modules/yams/yams.plugin.inc.php’);
System Events:
- OnParseDocument
- OnWebPagePrerender
- OnDocFormSave (Only required if you have selected the option to synchronise
the main document pagetitle with the default language pagetitle for
mulitlingual documents)
what does red mean?

step 2 of the setup tab is the next one:
Decide on URL format
Server Name mode and Root Name mode
how and where do i get it done?

to be honest, that’s not all, there’s more that i don’t grasp... i know, i sound a bit foolish, please don’t get me wrong, the documentation of YAMS is very good!
it’s just not comprehensible for non-developers like me.

but i want to use YAMS, it must be good, after all i read about it smiley
if someone is willing to take, erm, my hand and lead me through, i’ll jump hiiiigh and praise the day!
no really, i’d appreciate it heaps.

i’m good at translating, i could do the german part, well, that’s what i can offer.

finally, may i ask to excuse my opening a new thread, i didn’t know where to "start" otherwise.

best and with anticipation, burn]]>
https://forums.modx.com/thread/45433/yams---am-i-the-only-one#dis-post-521013 Fri, 20 Feb 2015 08:27:40 +0000 https://forums.modx.com/thread/45433/yams---am-i-the-only-one#dis-post-521013
<![CDATA[Yams - no error page shown, instead i get "too many forward attempts]]> https://forums.modx.com/thread/94836/yams---no-error-page-shown-instead-i-get-too-many-forward-attempts#dis-post-515759 I do have a problem with yams and evo 1.14
The site is available in english an german, build in this way:

We now recognized, the errorpage is not shown up for a wrong or old address like
its resulting in "To many forward attempts!"

but its working for

The .htaccess thingy is not a well know friend to me, but it that the point to start to solve this problem?

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

# Fix Apache internal dummy connections from breaking [(site_url)] cache
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]

# Exclude /assets and /manager directories and images from rewrite rules
RewriteRule ^(manager|assets)/*$ - [L]
RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]

# Rewrite "www.example.com -> example.com" all domain
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Redirect from mydomain.com/rootname to mydomain.com/rootname/
RewriteRule ^de$ de/ [R=301,L]
RewriteRule ^en$ en/ [R=301,L]

# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^de/(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

And if yes, can you please give me a hint? smiley

https://forums.modx.com/thread/94836/yams---no-error-page-shown-instead-i-get-too-many-forward-attempts#dis-post-515759 Thu, 27 Nov 2014 10:34:47 +0000 https://forums.modx.com/thread/94836/yams---no-error-page-shown-instead-i-get-too-many-forward-attempts#dis-post-515759
<![CDATA[Problem with Yams and ManagerManager - no more language tabs?]]> https://forums.modx.com/thread/95260/problem-with-yams-and-managermanager---no-more-language-tabs#dis-post-515734
I do have a problem with Yams and the Managermanager, I do not have Language Tabs after the last Evo Update (1.15)

Im not sure if its a yams-problem or a MM-Problem, (heres the original thread: http://forums.modx.com/thread/95259/bug-managermanager-6-2-not-workin-with-yams-anymore#dis-post-515733)

I think the error lies somewhere in this file:
require( $modx->config['base_path'] . 'assets/modules/yams/yams.mm_rules.inc.php' );

Anyone who can help?

https://forums.modx.com/thread/95260/problem-with-yams-and-managermanager---no-more-language-tabs#dis-post-515734 Thu, 27 Nov 2014 03:50:16 +0000 https://forums.modx.com/thread/95260/problem-with-yams-and-managermanager---no-more-language-tabs#dis-post-515734