Can the CMS be setup with Remote Folders?

@ben I’m curious if the CMS can be set up to point to a remote folder when using a Collection?

I have a situation where I have two sites sharing the same MD files, and it would be handy if I could place them in one location and then have them be accessed by the CMS. That way, I can just edit them in a single location and have the changes applied to both sites.

Is it as simple as just adding a path to the folders when setting up the collection?

UPDATE: Obviously, not as I tried that approach and it did not work!

What is MD files?

Markdown files that are used by the CMS.

tnx

The folder of markdown files must reside on the same server as the CMS.

We are looking at adding a JSON API to the CMS that would give you a public API for your content, but that’s not going to happen for a while (we have lots and lots of things we need to do before then).

Also, if you were to use an API in your frontend (javascript) to fetch and display content, you need to be aware of the implications of doing that — for example, the content is rendered only on the client, not server side, which might be an issue depending on the site :slight_smile:

In my case they would be on the same server. But I can’t seem to get it to work. I tried entering a URL to the appropriate folder. But when I tried to access the files nothing showed up. Maybe I did something wrong. Will do more testing in the morning.

it’s not going to work unless the folder is in the same project.

We don’t support folders of markdown files from outside of the current project. I think technically it might work if you figure out the correct relative folder path to the shared markdown files, but that will be unsupported and be very prone to breaking — therefor I can’t recommend you do this!

That is a pity as it seemed like to would be really handy to have them be remote.

What constitutes inside the current project, does this mean it has to be a folder in the page hierarchy like we have been doing, or is it something else?

As long as it’s on the same server it will work.

Just create an empty folder in Elements that you want to link the CMS to, you can then store all the content in that folder on the server.

Does that make sense? and would that work for you?

@dan I’ll give it a try, sounds like it should work fine. I already have a folder called “cms” where these files are currently located in my project. I’m assuming this would be a separate folder under my control, correct?

UPDATE: I tried this and it did not work. At first it would not add the folder to the server unless I put a placeholder finle inside it. Once it was up there I populated it with a number of folder full of MD files. I then pointed the collection to one of the folders and got nothing. Maybe the URL needs to be a special format, I tried a number of variants but none of them worked.

Ah yes, you’d probably need to have at least one markdown file in there so Elements knew to upload it. If you get it working locally, it should then work online with all the files on the server :slight_smile:

I tried, but I could not get it to work. Will just stick to what works for now and hope for an improved approach in the future.

you cannot link the CMS components to a URL — that’s not going to work.

The link to either a collection (folder) or a single item, needs to be relative to the page the component is on.