We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17544
    • 86 Posts
    The current MODx doesn’t allow one to use slashes in alias. I think the reason is because it will mess up with ’Use Alias Path’ setting.

    Is it possible that in newer MODx, we are allowed to use slashes in our alias given that ’Use Alias Path’ is turn off? This will make the friendly URL very flexible. It make it extremely easy for others to migrate to MODx by keeping all their old URLs easily.

    Although you might say that by turning on ’Use Alias Path’ and put the documents in the correct hierarchy, it can certainly preserve most of the old URLs, however, it will kill the flexibility on how to arrange documents in MODx. We can’t simply move a document from a folder to another because it will affect the URL. If a folder get too large, we also can’t create a few folders to group them because it will break the URLs.

    Personally and idealy, I think the feature ’Use Alias Path’ and ’allow duplicate alias’ should be removed in newer version. If a user has turn on ’Use Alias Path’, the upgrade will merge the path to the new alias.
      • 22303 MODX Staff
      • 10,725 Posts
      I think you should be free to choose how you use aliases. But I definitely do not agree that Use Alias Path and allow duplicate alias be removed. I use this feature quite often and would not be happy if it changed my individual aliases to a big string with dependencies on things that might need to be changed. This would also necessitate the removal of prefixes and suffixes too; how would those work?
        • 17544
        • 86 Posts
        haha, that’s why saying something is more easy than doing it. laugh

        Development of a project will evolve from previous codes, making transition is a very difficult task and might even lead to a nightmare for existing users to upgrade. (For example, when PHP have initially set register_global and magic_quotes on as default, it is very hard for web host to simply turn it off now because there might be existing scripts that rely on them). Making good decision at the beginning is very important and I am happy MODx has been doing quite well with this since the beginning. Maybe it is because it has a chance to look at other established CMS to know what they have not been doing well with. laugh (I am sure Joomla is headache now with implementing SEF because they didn’t start it right)

          • 22629
          • 194 Posts
          Just a quick question, don’t mean to hijack the thread, but it seems relevant!

          Is there a function in ModX that will build the alias URL?
          E.g. in my site I use friendly aliases with alias path on. If I have a document, say at:

          <modx root>/journal/2006/january/01.html

          Then here, .html is the suffix, 01 is the doc alias and /journal/2006/january is the alias path.

          How do I make a self-referencing link? For example, if I wanted to make my own link, I could say in the page:

          <a href="<modx root>[*alias*]">

          But that would give me "<modx root>/01"

          How can I add in the alias path and suffix without hard-coding it?

          Thanks,

          Andy.
            Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

            modx Revolution 2.2.6
            Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

            Content-Managed Websites Built on MODX
            • 26435
            • 1,193 Posts
            [~[*id*]~] if linking to self (like in a form who posts back to self)
            or [~[62]~] where 62 is the actual ID of the page you want to link to.

            -sD-
            Dr. Scotty Delicious, Scientist.
              Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
              All of the above... in no specific order.


              I send pointless little messages