I'm going to attempt to use one drupal install for 5 or 6 sites. Basically the website is a media company that owns radio and TV stations so if possible it'd be nice to have one login. The difficulty is dealing with the themes. I think each site would have it's own theme. Is that doable with the site config? Here is looks like with each site config you could specify a different them it looks like. Is this what I want?

$conf = array(
   'site_name' => 'My Drupal site',
   'theme_default' => 'pushbutton',
   'anonymous' => 'Visitor'
);

Comments

capmex’s picture

5 or 6 sites are you referring to different domains or subdomains? According to the multisite instructions in the drupal install.txt file, each site can have its own themes and modules, you just need to create the appropriate structure under the folder /sites, like: /sites/example.com/themes and /sites/example.com/modules

Carlos Miranda Levy’s picture

Here are two different approaches...

For the one login thing

Have all sites registration forms and links point to a single registration site, ie. members.mymediacompany.com.
Then, modify the log in form in all of your sites so that @members.mymediacompany.com is included after the log in name variable before having it processed.

For one site looking like different sites depending on url

If you don't want to do multisite, so you can have single login and manage just one site, you can build a generic theme that uses different elements, depending on the urll it is been called for. I'm doing that for one of my sites that serves different communities so that when users log in from one domain, the look and feel for that domain is displayed. I have not uploaded that, so I can't show it to you in Drupal, but I can show you an example of the same thing I did with a Menalto Gallery's theme.

Look at http://galeria.civila.com - then http://galeria.redargentina.com - then http://galeria.redebrasileira.com - then http://galeria.redcaribe.com

It's the same site (the domains point to the same site and IP) and the same theme.

The trick is to create a subfolder within the theme directory that contains the images to use for each domain (you could also include different .css files although I haven't tried it).

Basically assign the value of http_host (that is the mymediasite.com component of the url and it's generated by the server) to a variable and use that variable to build the location addresses of your images and interface files.

The code below is more or less how I did it in gallery and it's tpl not phptemplate, but it serves to illustrate the example.
(Note that I'm not assigning http_host to a variable but using it directly to keep the example simple).
I repeat, the code below is tpl, not phptemplate, so you need to change the calling of http_host to a normal php string concatenation.

<table border="0" cellpadding="0" cellspacing="0" width="100%" 
  background="/themes/generictheme/{php}echo $_SERVER['HTTP_HOST'];{/php}/background.jpg">
     <tr>
          <td align=left>
               <img src="/themes/generictheme/{php}echo $_SERVER['HTTP_HOST'];{/php}/left.jpg" border="0">
          </td>
          <td align=center>
               Here goes the banner code
          </td>
          <td align=right>
               <img src="/themes/generictheme/{php}echo $_SERVER['HTTP_HOST'];{/php}/right.jpg" border="0">
          </td>
     </tr>
</table>

Hope this at leasts gives you ideas for possible solutions...

------
Con paciencia y calma,
sube un burro a una palma

Ryan Palmer’s picture

Yes, this is what you want. Just have a different theme for each station, and hard code the theme selection in your code you just wrote there in each settings.php file. Luckily, too, as of 4.7, you can better handle blocks configuration according to which theme is active, amoung other things.

If you want to go one better, try the taxonomy_theme module. That way you can override your theme selection depending how you categorize your content.

Example:

weblogs.upei.ca
radio.upei.ca
cadre.upei.ca

are all on the same Drupal install, just different themes and different front pages, hard-coded in their respective settings.php files.

drupalninja99’s picture

so I should change the theme based on the url is what you're saying? and I should do that in settings? Do you know how to force a user to a location, so that if they type in http://sitename.com or www.sitename.com or whatever that it will take them to the same place and not mess up my settings?