YAMS Installation
Last edited by JP DeVries on Aug 9, 2013.
Language Variants
Page: YAMS Installation |
Page: Instalar YAMS |
Page: YAMS Installation (de) |
Installing and Updating YAMS
Pre-requisites
YAMS has been developed on MODx v0.9.6.3 and with PHP >= 5.2.6-3. It will not work on servers running PHP 4.
ManagerManager is not required for YAMS to function, but is recommended. YAMS can use ManagerManager to hide redundant document variables and to obtain a tabbed layout in the document view with one tab per language.
Upgrade/Update Instructions
To upgrade/update from a previous version do the following:
- Rename the 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 the yams.config.inc.php file from the old yams directory into the new yams directory.
- Make sure that the new yams directory and the yams.config.inc.php file (if it exists) are writeable by the server user/group.
- Make sure that the YAMS plugin is set-up to be active on all the necessary events. The list of events has changed from version to version. Please see the readme.txt contained in the YAMS download for the specific events required for the that version.
- Check that YAMS always appears first in the plugin execution order for each event that it is active. In particular, if PHx is installed then YAMS should appear before it in the OnParseDocument execution order.
- Check that everything is still working and that the settings are correctly displayed in the YAMS module. If so, the old yams directory may be removed. If there are any problems, then the old installed can be reinstated by renaming the directories.
Installation Instructions
- 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->config['base_path'] . 'assets/modules/yams/yams.plugin.inc.php');
System Events: Please refer to the readme.txt in the YAMS download.
- Within MODx under Elements > Manage Elements > Snippets create a new snippet:
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->config['base_path'] . 'assets/modules/yams/yams.snippet.inc.php' );
- Within MODx under Modules>Manage Modules create a new module:
Module name: YAMS
Description: Yet Another Multilingual Solution
Module code:require_once( $modx->config['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 to set it up. - Follow the instructions on the Setup page to setup your multilingual site.
ManagerManager Setup
To set up ManagerManager so that it provides a tabbed document interface, please
do the following:
- Check that the ManagerManager plugin is installed under Elements > Manage Elements > Plugins. If not, it can be obtained from the MODx repository. The latest version is generally recommended, but please keep an eye on the forums for reports of any problems.
- 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.
PHx Setup
If using the PHx snippet then please note the following. For some reason, a file specified using include_once gets reincluded and this causes the PHxParser class to be redefined, which generates a PHP parse error. This can 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.
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).