22 Jun 06:06
SPIP sites with multiple domain names
Hi all,
We've got a project coming up with some unusual requirements, so I
thought I'd ask on the list if anyone has any advice.
We will be building a SPIP site for a client which will be accessed
using a number of different domain names. Depending on the domain
name used, the site will have to display different content from a
different rubrique or secteur using a different set of templates
(product-specific "micro-sites").
Changing the templates is reasonably easy, if a little cumbersome, in
`mes_options.php`:
> switch ( $_SERVER['SERVER_NAME'] ) {
> case 'domain1.net':
> $GLOBALS['dossier_squelettes'] = "templates/domain1";
> break;
> case 'domain2.com':
> $GLOBALS['dossier_squelettes'] = "templates/domain2";
> break;
> default:
> $GLOBALS['dossier_squelettes'] = "templates/default";
> break;
> }
Handling the different content, though, I'm not sure about. My
current plan is to have a sector per site and have `{parent=...}` in
the `sommaire.html` in each template directory, but this is
inelegant. Can I add an `{id_secteur=...}` criterion to all
(applicable) loops in the appropriate `case` statement above?
Ideally, I'd like to move the above code into a plug-in and manage
all this from the back-end. Which pipeline is appropriate to set the `
$dossier_sequelettes` and other globals in this manner?
I'm also hoping to get some of the values from `spip_meta` done as
well (`#NOM_SITE_SPIP` and `#URL_SITE_SPIP`, in particular). Is there
a better way to do this rather than overriding
`balise_NOM_SITE_SPIP_dist($p)`, etc?
Finally -- though it should probably have been first
-- is there
already a plug-in to do this sort of thing?
Cheers,
Thomas Sutton
bouncingorange
RSS Feed