I have a website (ASP.NET MVC) which I would like to extend to another similar topic (like stackoverflow-serverfault-superuser).
Database layer and controllers layer are the same for both websites. What differs is just the view layers, and only for just a few detail: logos, masterpage and some resources files (in part) and CSS.
What's the best way to manage this situation? How is this accomplished by Jeff and his team?
My ideal goal is to have a single solution (Visual Studio solution), a project with controllers and model, and n different projects: each for every view. (added this line to clarify)
I get this done simply branching the two solutions (with SVN or Mercurial) and then merging while publishing?
Thanks guys!
We use the App_GlobalResources
folder to do this
with a helper class:
public static class Resources
{
public static string TeamEmail { get { return GetString("TeamEmail"); } }
public static string GetString(string key)
{
return HttpContext.GetGlobalResourceObject(
GlobalApplication.CurrentSite.ToString(), key).ToString();
}
}
and it appears in the view like so:
<a href="mailto:<%= Resources.TeamEmail %>">contact us</a>
For more total replacements (e.g., the /faq), we have multiple copies of the faq like so:
Faq-ServerFault.aspx
Faq-StackOverflow.aspx
Faq-StackOverflowMeta.aspx
The build renames the file appropriately for each server.
(Note that these are content views, so they are literally just the faq CONTENT itself, the master page determines the rest of the layout)