Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ran into this exact problem a few months ago when we started a significant rewrite of our web app. We had two separate versions of nearly identical sites. The back-end code was 99% identical, while the JavaScript, CSS, and other front-end stuff was very different. We had these two sites in separate trunks in the same SVN repository, and it soon became a nightmare of copying &amp; pasting common code between them. Patching and merging was too painful to be useful, due to slight variations in the files.</p> <p>Our solution was neither SVN-related nor builing of a common library. Instead, the concept of a separate site is defined in a single codebase via multiple config files and a heirarchy of CSS, image, and language resource files. Site-specific features are enabled by config values. </p> <p>Each site gets a unique name (say, "foo" and "bar"), which is retrieved from the Web.config file at run-time. The name is used to determine which config file is loaded and which client-side files to use. The setting is blank in SVN. It is set by our deployment scripts when copied to the web servers. On our local development machines, an environment variable defines the site we want to work with.</p> <p>The file structure of the site-specific files would look like this:</p> <pre><code>|- Config | |- AppSettings.foo.config &lt;- overrides Web.config AppSettings for "foo" site | |- AppSettings.bar.config &lt;- overrides Web.config AppSettings for "bar" site |- Content | |- CSS | |- main.css &lt;- default CSS file for all sites | |- main.foo.css &lt;- CSS overrides for "foo" site | |- Images | |- logo.jpg &lt;- default logo | |- logo.foo.jpg &lt;- logo used if site name is "foo" | |- logo.bar.jpg &lt;- logo used if site name is "bar" </code></pre> <p>This has worked great for us, so far. Adding a new feature to a specific site is as easy as adding the feature to our code-base, and only enabling it for that site.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload