-
☆ 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.
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.
-
☆ 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.
I just looked at the filesystem Media Source in my localhost install. All the paths are empty, but static elements work fine. YMMV.
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.]
-
☆ 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.