This is a user-contributed Extra. If you find issues or would like more info or help, please contact the author.
YAMS was originally developed for Evo v0.9.6.3+ and with PHP 5.2.6-3+. It will not work on servers running PHP 4.
Current version v1.3.0 has been released for compatibility with Evolution CMS v1.4+, v2+ and PHP 7+
YAMS uses ManagerManager to hide redundant document variables and to obtain a tabbed layout in the document view with one tab per language.
To upgrade / update from a previous version do the following:
To upgrade/update from a previous version do the following:
Rename your assets/modules/yams directory, to something else. For example assets/modules/yams_old or assets/modules/yams_v1.1.x
Copy the new yams directory to assets/modules/yams
Copy your yams.config.inc.php file from your old yams directory into your new yams directory.
Make sure that your new yams directory and the yams.config.inc.php file (if it exists) are writeable by your server user/group.
Make sure that your YAMS plugin is set-up to be active on all the events described in the installation instructions below.
Caution :
Check that YAMS always appears first in your plugin execution order for each event that it is active. In particular, if you have phx installed then YAMS should appear before it in the OnParseDocument execution order.
Check that everything is working and that your settings are correctly displayed in the YAMS module. If so, you may remove your old yams directory. If there are any problems, then you can simply roll back be renaming your directories to reinstate your previous yams directory.
You can install YAMS via Extras. If you do so please assure, that YAMS is at the first place in the execution order of all plugin-events which it is associated to.
Copy the yams directory to assets/modules/yams
Make sure that the assets/modules/yams directory is writeable by the user/group that your server runs under. YAMS maintains a config file called config.inc.php in the directory that is automatically updated via the module interface.
Within MODx under Elements > Manage Elements > Plugins create a new plugin:
Plugin name : YAMS Description : Yet Another Multilingual Solution Plugin Plugin code :
require( MODX_BASE_PATH . 'assets/modules/yams/yams.plugin.inc.php');
System Events :
Note that YAMS should be moved to first place in the execution order for all events to which it is associated.
Snippet name : YAMS
Description : Gets multi-language content.
Snippet code : (The following line needs to be placed between the opening and closing php markers)
require( MODX_BASE_PATH . 'assets/modules/yams/yams.snippet.inc.php' );
Module name : YAMS Description : Yet Another Multilingual Solution Module code :
require_once( MODX_BASE_PATH . 'assets/modules/yams/yams.module.inc.php' );
Reload the page to update the manager view. If you want to use ManagerManager to obtain a tabbed document interface then follow the instructions below (point 5) to set it up.
Browse to http://docs.evo.im/en/04_extras/yams.html for help setting up your multilingual site.
To set up ManagerManager so that it provides a tabbed document interface, please carry out the following:
Check that the ManagerManager plugin is installed under Elements => Manage Elements => Plugins.
Modify the ManagerManager plugin configuration so that it knows to find custom ManagerManager rules in a chunk called "mm_rules". In newer versions this can be set using the configuration tab. In older versions this is done by including the line
$config_chunk
=
'mm_rules'``;
in the plugin code.
Under Elements => Manage Elements => Chunks, create a chunk called "mm_rules" and add the following line:
require($modx->config['base_path'] . 'assets/modules/yams/yams.mm_rules.inc.php');
If you are already using custom ManagerManager rules, then it is advisable to place the YAMS require line at the end of the rules.
If you are using the PHx snippet, please take note of the following:
For some reason, a file specified using "include_once" is re-included and this causes the "PHxParser" class to be redefined, which generates a PHP parse error. This can be avoided by modifying the PHx snippet to wrap the include in some code that will only include the file if the class has not yet been defined:
if( !class_exists('PHxParser') ) { include_once $modx->config['rb_base_dir'] ."plugins/phx/phx.parser.class.inc.php"; }
Also, please remember that the Plugin Execution Order must be edited to place YAMS in first place - that is before PHx - on all associated events.