Developing Multiple Sites With Little Changes

i have to develop 3 different sites

domain names for example only

Almost 80% of functionality is same for all the three with rest 20% being completely different features… how do i handle it. I am not talking of simple differenced like video to audio to documents but more complex like docs may have editing but other 2 doesn’t or video and audio have related items but doc doesn’t

I was thinking of having these different features as modules and rest as core but

[list=1]

[*]how do i handle themes i.e each site has a different theme which is mostly css with little html changes

[*]In this case the menu/code links in html code become difficult as they may or may not exist for a particular site

[/list]

would this structure help http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/

All three would finally be hosted separately

I might implement all of it as one application and then at deployment I’d configure each to handle only one media type.

As i said 20% code differers between the three so it can’t be developed as one simple application.

It’s not just media-type that changes

I would build components/extensions for the common part used in 3 different website.

In this way everything that is really common would be in one place and everything else ready to bi customized.

I had the same problem, but this were 3 autoparts sites.

I made a Project Properties component where used class factory for each module on sites

My sites has differense only on this component proprties and a markups.

I used same database also. But hide some fields and columns in code, if need, using Progect Properties

##Install

Copy component to your folder application.components.

Add to config/main.php:




    'import' => array(

	... 

	'application.components.ProjectProperties.ProjectProperties',

	...

    ),



##Example for using




$catProp = new ProjectProperties('core');

if ($catProp->getProperty('ShowProperties','SearchMenuOnMain')) {

	$this->widget("application.modules.search.components.SearchWidget");

}



"core" - name of module. Propertes for module core will be find in CoreProperties.php file

"ShowProperties" - name of called function

"SearchMenuOnMain" - sended parrameter

See Attach