We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29796
    • 91 Posts
    Sadly I don't follow modx development much as i'd like to, so I'm not up to date with all nice modx features.... So I have two general questions.

    1. Modx shared core?
    http://rtfm.modx.com/revolution/2.x/getting-started/installation/advanced-installation
    In this article is written "This allows you to run multiple sites with a shared core" ..
    1.1 This means that you can have multiple websites with one core?
    1.2 How you manage all addons which installs in core/components ?

    2. File Abstraction Layer? When you add a link to an image or file inside RTE a fixed path is defined to that file and if you move it to another location you can cause a lot of brooken links and references to none existing files. Do Modx have anything to solve this problem ?


    This question has been answered by BobRay. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      1. Yes. It's done with contexts. The addons are still installed in core/components. The Manager always knows where the core is, that's why it has a config.core.php file in the /manager/ directory.

      2. Media Sources. http://rtfm.modx.com/revolution/2.x/administering-your-site/media-sources
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29796
        • 91 Posts
        1. No is not what I ment. I know how to setup multiple sites in one modx installation, but i'm talking of multiple sites with individual manager interfaces and all of them using same core.

        2. Media sources are only the "place" to store files and if I'm not mistaken those files aren't indexed, so if you move a file from one folder to another inside same mediasource all references to that file will be lost.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ah. Yes, I've heard of this, one way I heard about involved memcached. I've never done it myself, though.

          Ok, at that kind of granularity, no, I don't know of any way to index files.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Actually that last is not exactly true. I do know someone who has worked out a way of using resources to serve binary data, particularly images, so a standard link to a resource will serve the image. No files to worry about. [ed. note: sottwell last edited this post 11 years, 7 months ago.]
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 29796
              • 91 Posts
              All files should be indexed and all references stored to database, so when you need any file you just point it to it's ID. Of course there is need for a plugin that updates file paths and names, when someone renames or moves them around + a script which changes ID-s to file path + a script to clear / update cache.

              And about shared cores... in "advanced installation rtfm" is written that you need to change "Configuration Key" if you want to run multiple sites with shared core. So i'm guessing that is possible, but I don't know how you deal with extras and if each sites has it's own "manager" or is shared too.

                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Such a file indexing system could be done as long as files are only managed using the MODX file manager. It has several events that could be used in a plugin to modify the file's metadata. Another plugin could be used to parse a completed resource and update all image and other file paths.

                There has been some discussion of this before.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 29796
                  • 91 Posts
                  So in short answers for may 2nd question is: No, Not yet ... but shouldn't be to complicated to implement. smiley

                  What about shared core? .. anyone ?
                  • discuss.answer
                    • 3749
                    • 24,544 Posts
                    I'm talking of multiple sites with individual manager interfaces and all of them using same core.

                    There's a section in my book showing several different ways to have multiple sites sharing the core and/or the DB, but I don't think there's any coverage of multiple Managers and multiple file systems sharing the same core. I think it's theoretically possible, but I don't think I'd recommend it.

                    As for the file links, you can make them relative to a media source, so you could move them and change the media source if they still have the same directory structure. Otherwise, I'd recommend putting the files where you want them and leaving them there. wink
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 29796
                      • 91 Posts
                      I read your book and built few multiple sites using one modx installation, but I'm wondering if shared core is possible, so you could update the core for multiple sites. For example... if you have 100 sites using modx on one server and you want to update them. What is the easiest and fastest way? copying the core and setup folder to each installation and run setup is very painful.

                      As for files... I usually put files where I wanted them to be, but clients are problematic. They often change files location in media sources and cause problems. Some CMS systems index files and write path to DB and don't have such problems. Modx is a little behind in this field. Most problematic are big sites with a lot of files, because after 2-3 years they allways want to remove some unused files and arange them to a new location. Currently is impossible to know which files are used and which are absolete.