We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Sorry if this has been answered, but the search feature on the forums here is completely failing at the moment.

    On a new setup, I've got a handful of static elements (e.g. templates). I can see the files I've added to the filesystem, and when I'm editing a template, I can choose the new file, but the contents never shows up in the editor -- it always appears as if the selected static file is blank (even if the permissions are at 777).

    This is making me go completely mental. Anyone have any ideas of what might be the cause? The problem isn't limited to just the editor: the templates don't render at all on the front-end because apparently MODX thinks they really are blank. I can save data to them, however: if I paste some text into my static template and hit save, the data does go to the file, but I've noticed it goes to the WRONG file... it's like the Media Source is not correctly configured.
      • 3749
      • 24,544 Posts
      The Media Source being wrong is the only thing I can think of that would cause that, unless there's something goofy about the file path.
        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
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Does the {core_path} placeholder work in Media Sources? I'm seeing errors in my logs when I tried that, so it seems that's not a viable way to reference an absolute file path... using a relative path seems to always go wormhole on me: e.g. if the rel path is defined as "elements/templates/", saving new content to my template ends up creating "elements/templates/elements/templates/" etc.
          • 3749
          • 24,544 Posts
          I just looked at the filesystem Media Source in my localhost install. All the paths are empty, but static elements work fine. YMMV. wink

          My images Media source has this:
          basePath /assets/images/
          baseUrl /assets/images

          My Subscribe Media source has this:

          basePath: assets/mycomponents/subscribe/core/components/subscribe/elements/
          baseUrl: assets/mycomponents/subscribe/

          TBH, I don't know why I set the last two that way or if they are correct. I find Media Sources baffling. [ed. note: BobRay last edited this post 13 years, 1 month ago.]
            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
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            Ah, I think I got it: besides a couple glitches in the media source definition, the MODX file browser that popped up was using the regular "Filesystem" media source whereas the template was set to use a different "Template" media source. Lord, that's confusing.
              • 39519 ☆ A M B ☆
              • 79 Posts
              Quote from: Everettg_99 at Aug 28, 2013, 05:05 PM
              Ah, I think I got it: besides a couple glitches in the media source definition, the MODX file browser that popped up was using the regular "Filesystem" media source whereas the template was set to use a different "Template" media source. Lord, that's confusing.

              You should also be able to add a template specific "default_media_source" in the properties of the template.
                Mat Dave Jones