The actual MODx parser is in /manager/includes/document.parser.class.inc.php.
Hope that helps!
Maybe you need something like an OnMakeUrl event so you can modify all your MODx generated urls from a plugin without having to hack the core, correct?
Yeap, actually I still need to hack the core though, I change the makeFriendlyURL() and makeURL() function to make sure that every friendly alias path need to be outputed, it will remove all the leading alias virtual directory, which based on the name of the domain being used.
For example, "subdomain.domain.com/home.html". The "subdomain.domain.com" is the first folder level that is going to contain all the documents specific to that subdomain. So in this case, both of the methods, instead of outputing that, it will remove the "subdomain.domain.com", and return "home.html".
Now the last bit that I need to change is executeParser() function, which is before the event onWebPageInit, I hack into the function and change $alias variable to be appended with "subdomain.domain.com", before the $alias variable being processed and returning the exact document.
All the changes will only happen, when the alias path option being enabled in the manager setting. I also plan to have a new configuration setting, to enabled this mode, which allow subsite or not, if it is, then all the changes in that 3 functions will run, if not, it will proceed as standard MODx system.
Do you think this is do able? Did I cover all the basic ground for subsite? I did the changes of the executeParser() function and it works.
Please let me know if I do wrong, and I really appreciate all the helps, because I’m not a good PHP programmer, so any help from the core coder will be awesome.
I think it’s workable but you just have to give it a try.
My last question, hopefully.
Is there anyway to search document id based on their alias, other than going back and forth of the database? Is there any function available to do that? I haven’t check the API function yet, but if somebody could direct me, it will be great.
How do I add a new option under manager setting inside the core code to have subsite disable or enable option?
Jason, if you can give me a hint, it will be really2 awesome.