Jump to main content Jump to doc navigation

Media sources

The major change in 2.2 is Media Sources. They abstract the “Files” tab in MODX so the Files tree can draw from several sources: the filesystem, an S3 bucket, or other types. They integrate into most of the Manager, including the MODX.Browser, Template Variables, and general file operations.

For an upgrade, that means all filemanager_* settings and the basePath/baseUrl TV input options are deprecated. The Manager no longer uses them: sources now determine the basePath and baseUrl of the tree, which makes the tree’s behaviour much more stable.

MODX alters the baseUrl and basePath of the default Source for filemanager_* system settings. TV input options with a custom basePath get new Sources, associated with those TVs automatically.

filemanager_* User Settings need to be migrated by hand, as user-specific source basePaths no longer exist. Use ACLs on the Media Source with a User Group, which you can learn how to do here.

Static elements

MODX 2.2 introduces “Static” Elements: Elements that live on the filesystem through a Media Source. Create an Element (Chunk/Snippet/Template/etc) and check the “Is Static” box. Two fields appear:

  • Static Source - the Media Source to use when looking up the Static File. Select None to specify an absolute path to the file.
  • Static File - the path to the file, relative to the media source you selected (or None for absolute paths). You can use tags in this field, such as System Settings.

For example, with a File System Media Source with a relative base path of ‘assets/’ and a Source File of “templates/test.tpl”, the Template file is looked up in “/path/to/my/modx/assets/templates/test.tpl”.

Dashboards

Your main Dashboard will look slightly different; the basic widgets and functionality are the same. You can now create custom Dashboards for different User Groups and assign Widgets to them. See the Dashboards documentation.

Other changes

Settings from this section at a glance:

Setting Value What it changes
context_tree_sort, context_tree_sortby Yes, rank Drag-and-drop sorting of Contexts in the Resources tree (off by default)
compress_js, compress_css 0 Turns off CSS and JS compression in the Manager (on by default)
tvs_below_content Yes Shows Template Variables below the Content panel while editing a Resource

Sorting contexts in the tree

Sorting of Contexts is available in the Resources tree, but off by default. Set the context_tree_sort System Setting to Yes and change the context_tree_sortby field to “rank” to drag/drop sort Contexts in the tree.

Primary user group

Users can have a “Primary” User Group: the group they belong to with rank 0. A user in only one User Group gets that group as their primary.

Minify in the Manager

The MODX manager compresses the CSS and JS in the manager with Google Minify. It is on by default; set the compress_js and compress_css System Settings to 0 to turn it off.

Form Customization tweaks

With the new user interface on the Resource Editing screen, Form Customization can target specific columns in tabs to move TVs to. Their IDs are listed under the “Tabs” tab when editing a Form Customization Set.

Comment tags

MODX users can use comment tags in their content:

[[- comment goes here]]

Anything within one of these tags is removed prior to the page rendering.

Moving TVs below the Content panel

In 2.2 you can move Template Variables below the Content panel when editing them in a Resource: change the tvs_below_content setting to “Yes”.

Upgrading/installing via command line

In 2.2, MODX is installable and upgradable from the command line. See Command Line Installation.

Pre-processing default element properties and property sets

Elements can be told to pre-process MODX tags in default property and property set values. When the box is checked on the Properties tab, the Element parses every tag in those values, so the behaviour matches a property set written directly in the tag string. Otherwise the tags reach the Element unprocessed.

See also

  1. Troubleshooting Upgrades
  2. Upgrading from 2.0.x to 2.1.x
  3. Upgrading from Versions Earlier than 2.0.5
  4. Upgrading to Revolution 2.0.0-rc-2

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • A. Moreno
  • Alex
  • Chris Fickling
  • Stéphane Jäggi
  • YJ
  • Murray Wood
  • JT Skaggs
  • Anton Tarasov
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$185 per month—let's make that $500!

Learn more