= Virtual Domain Extension This extension is based on a behavior from theplant.jp to allow hosting multiple sites from one radiant install. Contributors: * Brian Gernhardt * keita * Todd Willey * J Aaron Farr For discussion, join one of the Radiant mailing lists (see radiantcms.org for details). = Virtual Domain Behavior Having decided to use Radiant on a new project consisting of 4 distinct websites for a client, we had the problem of either installing radiant 4 times, or coming up with a way to get it to support multiple websites. Out of the box, Radiant is beautifully simple, but of course simplicity equals a reduced feature set. Radiant does however have a nice way of adding functionality called "page types". So after hacking away for a day or so, I was able to produce a plugin to handle virtual domains (having e.g. blog.theplant.jp, clients.theplant.jp instead of theplant.jp/blog or theplant.jp/clients). You can get it via subversion from http://theplant.jp/svn/code/radiant/plugins/virtual_domain. Once the extension is installed, start radiant, go your admin screen and select the root page (the one at the top of the list) and change its page type to "Virtual Domain". Once you do this, the front page of your website will be selected from the children, by trying to find a child whose page-slug is included in the host. For example if you have a child with a slug of "blog", and go to http://blog.theplant.jp, that child will be used as the root-page, and all of the Radiant tags that generate urls (, etc.) will draw the urls correctly. If this isn't quite what you need, you can create a page part named 'config' in the virtual-domain page, and add something like blog.theplant.jp: articles code.theplant.jp: development i.e. domain: slug and the behaviour will use this to find the child (using a regexp of /domain/ =~ request.host). You can add a default child with *: and then anytime someone accesses your site with a host that doesn't match any others in the config, it will use this page as the default. Enjoy! = Sharing pages between domains As of version 1.2.3 the r:find tag works with finding pages from other sites under the same VirtualDomain root by prefixing the path with a colon and the hostname of the host you would like to find the page from. ...