We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11203
    • 6 Posts
    Hi there,
    I am a recent convert of ModX, having run a couple of etomite sites over the last 3 years. I discovered ModX a few months ago, and eventually decided that it was worth the upgrade for all the great new features and the more active community.

    So today, after the obligatory backups etc., I did an upgrade of my etomite 0.6.1 installation to the latest ModX. First of all I have to say I like what I see and the first impressions are very positive. grin
    Everything seems to have gone without a hitch (I was worried about database death!) apart from one thing. sad

    In my etomite site pages I used links to other pages in the database using their aliases. For example, a page with the alias ’introduction’, I would link to using the [~introduction~] tag. Having upgraded to ModX these no longer seem to work, but if I change the link tag to use the document ID, i.e [~10~] then it works fine.
    The thing is, my entire site (upwards of 100 pages) is written in this way with link aliases and not document ID’s. Please please somebody tell me that I do not have to go through each page and rewrite every link as an ID number. Please?

    I searched the forums but couldn’t find any threads relating to this. If anyone can help I would be most grateful. *begs*

    Cheers

    Graham
      • 22815
      • 1,097 Posts
      I’ve never seen the [~aliasname~] format before, and so I assume it was either after The Great Forking or someone ditched it for being vaguely pointless.

      Assuming you have absolutely no [~1~] references, and that you have a flat system (ie [~monkeys~] went to monkeys.html and gorillas went to gorillas.html, not africa/monkeys.html and brazil/gorillas.html), and that your links were basically:

      <a href="[~monkeys~]"

      in the content,

      then you should be OK doing a search and replace on a backup of your decompressed .sql data:

      replace "[~" with "" and "~]" with ".html" (or whatever your extension is).

      There’s been talk recently of a MODx-based Search & Replace, but it’s not available yet.

      PS: I’ve amended your title to include "from Etomite to MODx".
        No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 11975
        • 2,542 Posts
        Hi,

        that’s not exactly what you are looking for but could be useful.

        http://modxcms.com/forums/index.php/topic,2763.html

        That way you could search "[~" and replace with "[~[+alias:" and "~]" with "+]~]"
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 11203
          • 6 Posts
          ah, thank you both. Those are good solutions. My site is completely flat (no extra paths) so the second option I think is more preferable as it does not render fixed file links.

          I am still only getting to grips with ModX, but after reading that Aliaslinks plugin, I’m sure it must be possible to write a plugin which executes on each page render and searches the document for all link tags (between [~ and ~] ) and then replaces the alias text with an appropriate doc ID. However, I think such a thing is a bit beyond me right now huh

          A built-in database search and replace function would be great. *goes off to see if I can do that live with phpmyadmin....*

          if anyone else has an easier solution (I don’t expect there is one) I’d be grateful to hear it.

          Thanks for your help.
            • 11203
            • 6 Posts
            Wow. Excellent. i now have it all working. For anyone who may encounter a similar problem, here was my solution:

            I installed the Aliaslinks plugin (http://modxcms.com/AliasLinks-616.html) as suggested and then used phpmyadmin to run the two SQL search and replace commands:

            [tt]UPDATE etomite_site_content SET content = replace(content,"[~","[~[+alias:");
            UPDATE etomite_site_content SET content = replace(content,"~]","+]~]");[/tt]

            And that did it!

            Cheers all. I shall now bask in the new features of ModX!

              • 7455
              • 2,204 Posts
              Why would anyone use this format? why not use the [~idnumber~]?? I realy do not get it if the FURL are on this wil end up with the same link result as the alias link.

              maybe I am stupit but id’s never change but aliasses could be changed and then all the links to that page are not workin any more.

              or is it because when you are in the front editor you do not see the ID’s?

              Dimmy
                follow me on twitter: @dimmy01
                • 11203
                • 6 Posts
                Well personally I see it as an invaluable feature since I pick an alias when the page is created and then stick with it. It’s a lot easier when putting links into new pages to remember an alias than the ID number of a particular page. You are right in that I could just link it with alias.html but somehow it seemed better to do it within a database context which might offer me flexibility in the future (i.e. I can change them back to document ID’s if necessary)
                  • 22815
                  • 1,097 Posts
                  My view is that IDs are more likely to change than aliases! Certainly as I need to be concerned about bookmarks and external search-engine indexing of page names, I’m quite likely to swap alias names around as appropriate between pages as I develop them.
                    No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                    MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                    Forum: Where to post threads about add-ons | Forum Rules
                    Like MODx? donate (and/or share your resources)
                    Like me? See my Amazon wishlist
                    MODx "Most Promising CMS" - so appropriate!