I currently have a site with www.mysite.com and meet.mysite.com. Single install, single database, second site via prefix table.

I'd like to keep the theme in the subsite, but change the colors of links and header, so members recognize immediately they're on the other site (since they're otherwise very similar in layout.) How can I do this?

Comments

jraper@groups.drupal.org’s picture

Are you using a phpTemplate theme in Drupal 4.7 as your primary theme? If so - I can provide further howto.

mbw’s picture

And changing colors. I figure we'll work on graphics, etc., later, as for now, I'm more concerned about content and function than prettiness.

So the answer I guess is yes.

jraper@groups.drupal.org’s picture

Okay - here goes (quoted from "Building Online Communities with Drupla, phpBB, and WordPress" by Robert Douglass and friends):

You create a CSS theme by adding a directory inside a top-level theme like Bluemarine or Pushbutton. Inside the subfolder, place a style.css file, and you've created a whole new theme! Visit admin/themes to verify its existance.

The new CSS theme will use the HTML generated by the top-level theme and apply the style.css file in the subfolder. The theme will take its name from the name of the subfolder. For example, the file bluemarine/greenmarine/style.css would cause an entire new theme called Greenmarine to register on the admin/themes page. It would be identical to Bluemarine in terms if HTML, but would look completely different, based on whatever rules are found in the bluemarine/greenmarine/style.css file.

So - copy the bluemarine/style.css file into a new bluemarine/[newTheme]/ folder and then alter the rules in bluemarine/[newTheme]/style.css as you like. Your changes will apply to - and only to - sites that use the [newTheme] theme.

mbw’s picture

Thanks...You've been incredibly helpful over the past few days - I really appreciate it (I decided to multi-site without using OGs, btw, as I actually want to use them within the subsite for different functions (houseparties, meetups, newsletters, etc.)

joshhoegen’s picture

Hey! I had to deal with something similar a few times in this life... Can anyone in the community recommend why this is or isn't a good idea?

<?php  
header("Content-type: text/css; charset: UTF-8");
$subdomain = explode('.', $_SERVER['HTTP_HOST'], 2);
//for testing purposes: 
$subdomain = isset($_GET['subdomain']) ? @$_GET['subdomain'] : $subdomain[0];

	if($subdomain == 'sub1'){
		$main_color = '#3EABAC';
		$secondary_color = '#398787';
		$background_image = 'bg-menu-1.jpg';
		$h2_color = '#327C7C';
	} else if($subdomain == 'sub2'){
		$main_color = '#82AB3D';
		$secondary_color = '#6b8f2f';
		$background_image = 'bg-menu-2.jpg';
		$h2_color = '#6B8F2F';	
	} else if($subdomain == 'sub3'){
		$main_color = '#82AB3D';
		$secondary_color = '#6b8f2f';
		$background_image = 'bg-menu-3.jpg';
		$h2_color = '#6B8F2F';	
	} 

?>
.<?=$subdomain?> #main-content-wrapper h3.title{
	color: <?php echo $main_color; ?>;
}
.<?=$subdomain?> #main-content-wrapper h2{
	color: <?php echo $h2_color; ?>;
	font-size: 24px;
	font-weight: bold;
	margin:10px 0px;
}
.<?=$subdomain?> #main-content-wrapper a {
	color: <?php echo $main_color; ?>;
	text-decoration: none;
	border-bottom: 1px dotted <?php echo $main_color; ?>;
}

.<?=$subdomain?> #main-content-wrapper a:hover {
	border-bottom: 1px solid <?php echo $main_color; ?>;
}

.<?=$subdomain?> #site-menu ul li {
	display: table-cell;
	padding: 0;
	margin: 0;
	border: none;
	background: url(../images/<?php echo $background_image; ?>);
}

.<?=$subdomain?> #site-menu .active {
	background: <?php echo $secondary_color; ?>;
}

.<?=$subdomain?> #site-menu li a:hover, #site-menu li a:active {
	background: <?php echo $secondary_color; ?>;
}


.<?=$subdomain?> #sidebar-right h6 {
	background: <?php echo $secondary_color; ?>;
}
.<?=$subdomain?> .table-hold{
	background: url(../images/bg-table-<?=$subdomain?>.gif) no-repeat;
	padding: 0px;
}

.<?=$subdomain?> .submit-filter-results{
	background-color: <?php echo $secondary_color; ?>
}

.<?=$subdomain?> .date_header {
	background: url(../images/<?php echo $background_image; ?>) repeat-x;
}

Some things to keep in mind:
1. You need to set the header so apache serves the php as css. (header("Content-type: text/css; charset: UTF-8"); )
2. Depending on the php_ini settings you can shorthand echos with "<?=$var?>". (notice that there's no "echo" or semi-colon)
3. Depending on the criteria, you can use a for/foreach in place of my if-else.