Quick Fix – How to Change a Document’s Parent in MODx
I accidentally created a page that was at a sub-level of the first page, turning the first page into a folder. I can’t figure out how to undo my mistake.
This is an easy mistake to make, and sometime you may just need to change which docs are in which container and such. Fortunately, it’s actually pretty easy to correct and there are a couple of ways to do it, let me walk you through them. (Remember you can click on all the screenshots to see a larger view)
To start off, here is a screenshot of my document tree. I have created a document named Home, and within it is a document titled About Us.
In this case Home is a now a folder/container and About Us is contained in that folder.
If I want to remove About Us so that it sits in the root of the document tree and so that the Home document is no longer a container, there are two ways to do it, either by changing it from the Home (parent) page, or changing it from the About Us (child) page.
Method 1: From the Parent Document
Using this method, you can view all of a document’s children and edit and move them as needed. Click on the parent document/container (in this case Home), and then open the “View Children” tab.
This opens up a list of the child documents for the container. Click on the Move button for the child document that you want to move. The next screen will then show tell you the document that you’re choosing to move and allow you to select where you want to move it.
You now go to the document tree and click on the document that you want to use as the new parent. If that document is not already a container, it will now become one. In my case I simply want to move it to the root. So I go to my document tree and I click on the root of the tree, which for me is My MODx Site.
Once I click on it, the message on the page changes to reflect that I have selected the root as the new parent that I want to contain my About Me page.
Now all I have to do is save the document, and you’ll see the About Us page is now under the root and the Home page is no longer a container.
Method 2: From the Child Document
Another way to change a Document’s parent/container is from the child document itself. The method is pretty much the same, just the starting point changes.
Select the child page you want to move on the document tree. At the top of the document area there are several document options. Click the Move option.
You are once again presented with a similar screen as the one before telling you to now select the new container for your document.
From here you will follow the same steps as in Method 1 to select the new container, save, and your document will now be in its new container.
Method 3: From the Edit Screen
There is ofcourse a third way, and that is while you are in edit mode. Open the document you want to move for editing. Just above the main content area is the Document Parent area. All you have to is click on the little folder as indicated on the shot below.
It will then change into an open folder icon (it’s tiny so you may not notice it, but you should). Now, as before, select the new container in the document tree. It should now show the new container, as below:
You can see the open folder icon I mentioned in this screenschot.
The next step is simply to click the icon again to close it, and then save the document. Clicking the icon may not be completely necessary at this point but I do it anyway.
Once you save your document, it will now show up in its new location in the Document tree.
I’m sure there are probably other ways to do it, but there you go – Quick Fix! Problem Solved 🙂