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.
-
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?
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.
[~[*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.