Documentation

Installation

To install this package you have the following options:

  • Automatic installation
    1. Login to your site as an administrator
    2. In the Intelligent search enter "Multilingual attributes"
    3. Click on "Multilingual attributes" in the "Add-ons" section of the menu that'll appear
  • Manual installation:
    1. Download the zip file
    2. Unzip the zip file in your site's packages/ directory
    3. Login to your site as an administrator
    4. Find the "Add Functionality" page in your dashboard
    5. Find this package "Multilingual attributes" in the list of packages awaiting installation
    6. Click the "install" button
  • Installation with Composer:
    1. Install Composer
    2. add this to your composer.json file:
    3. {
         "require": {
            "mlocati/multilingual_attributes": "@dev"
         }
      }
    4. run php composer.phar install

Usage

Once this add-on is installed, you'll have a new attribute type for files, users and pages (you can change this in the dashboard of your site, under System & Settings > Attributes > Types).

For instance, if you want to add a localized description for files you may want to:

  1. In Dashboard, select Files > Attributes
  2. Add a new attribute of type Multilingual attribute
  3. Enter the handle and the name of the attribute
  4. In the Type field specify which kind of data the new attribute will contain (single-line text, multi-line text or rich-text/html)
  5. Specify what the attribute should do when the value is not specified for a language. For instance, if users are viewing a page in Italian, but the attribute value for Italian is not set, you may want to use the English value or the value of another attribute

Once this new attribute will be created, you can valorize it for any of the languages installed in the website.

Please remark that the fall-back to other attributes is only applicable for the core elements (pages, files, users). If you need other kinds of elements please send me a private message.