I am trying to find out, how to change the document id, after a new resource has been saved. My resources document ids look like this: Home (1), Page 2 (47), Page 3 (82), and so on. I need them to be like this: Home (1), Page 2 (2), Page 3 (3), and so on. Is there a way to change the document id, without the resource being a container? Thanks in advance.
best to use *menuindex and have your resources grouped that way you have control of your resources order.
-
☆ A M B ☆
- 24,524 Posts
Each resource and each element is given a unique ID on creation, and this ID is used internally by MODx for the lifetime of the object. Since many internal references are made to these IDs, it's not a good idea to change them. Just as one example, TV content is stored by TV ID and resource ID.
The resource ID order in the Tree doesn't matter at all; there are other ways to sort them. Basically, you just ignore the ID unless you need it for some reason (such as generating a URL).
If you tell us why you need those IDs set like that, we might be able to suggest a better way of handling things.
and ....
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
If you want to have your resources in the site tree in the same order as the pages on your website, then use menu index in Edit Resource to do that.
Brian.
-
☆ A M B ☆
- 24,524 Posts
If you're using Revo, you can drag-and-drop them into the order you want in the Tree. If you're using Evo, you can use the DocManager module and drag-and-drop them into order within the same branch.
Hello!
I'm also interested in changing the id's.
I know why it's a bad idea but I still need to do it.
I'm remaking a site from evo to revo. As the initial site has tons of [~id~] links I'm simply recreating in revo structure all the documents in the order they were input in the initial site.
The bad thing is that at one moment I've deleted a page and now all the new pages are generated with id+1 compared to what I need.
I can change the id directly in the modx_site_content table but any new page is again created with id+1 compared to what I expect.
Any idea on how I can solve this? Is there some "counter" I can reste in DB?
Thank you!
If you realy know what you are doing!
You can change the auto_increment for the site_content - table within phpMyAdmin
But, there are ways to import all of your resources,templates,chunks (with auto-converting MODX-tags) from EVO to Revo