Hi all. Great plugin Raymond!
I’ve spent some time playing with it, and combining it with a modified version of Susan’s UltimateParent to make a sort of
UltimateParentSubdomain. The idea is roughly:
- set the subdomains’ "root"/landing page,
- determine the subdomain,
- find the ultimate parent using the subdomain root ID instead of 0.
The problem is that links aren’t rendered with the subdomain. If I go to subdomain.boopaloo.com, the links on the page are for boopaloo.com/subdomain/item1.html, so once the visitor navigates away from the subdomain landing page, they’re no longer in the subdomain, which often isn’t what’s desired, and makes my snippet not work
I’m guessing the solution might be in
a plugin that loads on event OnFriendlyURLSettingsRender?, but I can’t get anything going. The plugin could check each link’s "ultimate subdomain parent" and apply the appropriate subdomain prefix to the link.
So, if doc2 = subdomain2, then any link to content that is under doc2 gets its link rewritten. (When using alias paths, it’d also be nice to strip the first alias as well, so instead of subdomain2.boopaloo.com/doc2/folder/content it’d just be subdomain.boopaloo.com/folder/content. This isn’t quite as important but it’d be nice.)
Does that make sense? Any ideas if OnFriendlyURLSettingsRender is the right thing to focus on, or any tips on how MODx makes the friendly URLs in the first place? I think this could be relatively simple, but I’m still new and don’t know where to look.
Having subdomians function like this would be amazing, and would open the door to some pretty cool stuff kind of like WordPress Multi User. It would also allow an UltimateParent for subdomains, which would make menus within a subdomian much easier, and even stuff like having a simple snippet to display a different header/logo depending on the current subdomain.

Thanks all!
Brett