We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6531
    • 154 Posts
    IS there any way to change a document ID ? Short of going into mySQLadmin and manually editing tables?

    thanks
      • 25663 MODX Staff
      • 12,272 Posts
      No, and be careful when doing so as there can be other resources linked to document IDs, like TVs.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If you’re doing it to make the Document Tree look neater, don’t! You’ll get used to it. You’ll serve no practical purpose by doing it, and might break parts of your site.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 6531
          • 154 Posts
          Arg! Is it possible I am being told there is something that can’t be done in MODx???? wink Unheard of!!!

          Darn. It would be great to have something like that in the Doc Manager Module. My IDs are a mess.


            • 3749
            • 24,544 Posts
            Quote from: danzg at Jul 20, 2008, 06:30 PM

            Arg! Is it possible I am being told there is something that can’t be done in MODx???? wink Unheard of!!!

            Darn. It would be great to have something like that in the Doc Manager Module. My IDs are a mess.

            You can definitely do it (people have), but there are certain risks and the improvement is entirely cosmetic. Most of us resisted the urge and learned to live with the document IDs we have. One solution is to reuse the document IDs by overwriting existing documents rather than deleting them.

            If you really can’t resist, the safest way is to just create a new MODx install and recreate your documents in the order you want.
              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
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              The document IDs are generated automatically by MySQL when the document is created; the ID field is the primary key and is auto-incremented. If you accidentally duplicate one, you can cause all kinds of havoc. Not to mention getting your TVs all messed up, and possibly your site start, error page and unauthorized page settings. Or if you have login page settings for web login or for individual users.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 25663 MODX Staff
                • 12,272 Posts
                Quote from: danzg at Jul 20, 2008, 06:30 PM
                My IDs are a mess.
                How’s that a problem? It’s just a unique identifying number with no other significance really. tongue
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 4856
                  • 55 Posts
                  I understand that IDs must be unique, may be links from documents etc.
                  BUT
                  Sometimes site admininstrator may create new document, then move it to other place or delete document,
                  and in result - first document have ID 7, next ID 14, and then ID 8.
                  When user navigating by site, page adress look like something unsorted, chaotic, user may to think that this site is not proffesional.

                  So, i think, this feature needed.
                    • 3749
                    • 24,544 Posts
                    You basically have four choices here:

                    1. Write a module that would renumber the documents and correct all the references to them. It would be a nightmare to write and could easily miss references that would mysteriously bite you later on and be extremely hard to diagnose.

                    2. Delete all the documents and re-create them in the correct order. Repeat whenever you don’t like the current sequence.

                    3. Explain to the user why the IDs are not in sequence (only necessary for manager users -- web users never see the IDs).

                    4. Design the whole site ahead of time and carefully create the documents in the correct order so the IDs *are* in sequence.

                    Take your pick.  wink

                    Most of us have opted for number 3.
                      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
                      • 33310
                      • 2 Posts
                      Quote from: cept at Jul 24, 2008, 01:49 AM

                      I understand that IDs must be unique, may be links from documents etc.
                      BUT
                      Sometimes site admininstrator may create new document, then move it to other place or delete document,
                      and in result - first document have ID 7, next ID 14, and then ID 8.
                      When user navigating by site, page adress look like something unsorted, chaotic, user may to think that this site is not proffesional.

                      So, i think, this feature needed.

                      Well, I always turn on friendly URLs and there you have an option to use the alias for the friendly URL. So all the user will see is yoursite.com/news, yoursite.com/about etc. - if you give your docs sensible unique aliases.

                      This is waaaay better to let them ponder over a random number and the user will think, wow, this is so professional, not even an extension in the URL. You can even have the document path in the URL, like yoursite.com/news/latest, but then you have to be careful about using absolut paths for images and stuff in your content and templates.