Setting Up A Sub-Site Under SiteFinity

posted on 12/28/07 at 11:15:51 pm by Joel Ross

On my current project, we're implementing Telerik's SiteFinity CMS product. It's an existing site, so there's lots of custom functionality that we still want to be able to use. Rather than building that into the main SiteFinity site, we opted to keep it separated and put it into a sub-site, with no references to the SiteFinity DLLs.

Of course, once you start, it's never as easy as it sounds. It's honestly not that bad, but there are a few things you have to add to your web.config in the sub-site to get it working. And I'm going to document those here for future reference, and for anyone else who might need this later.

Rather than go through piece by piece, here is a base web.config you can use that should work with sub-sites under a SiteFinity site.

   1:  <?xml version="1.0"?>
   2:  <configuration>
   3:    <appSettings />
   4:    <connectionStrings/>
   5:    <system.web>
   6:      <httpHandlers>
   7:        <remove verb="*" path="*.rss" />
   8:      </httpHandlers>
   9:      <customErrors mode="RemoteOnly" />
  10:      <compilation debug="true">
  11:        <assemblies>
  12:        </assemblies>
  13:      </compilation>
  14:      <roleManager defaultProvider="[TBD]">
  15:        <providers>
  16:          <clear />
  17:        </providers>
  18:      </roleManager>
  19:      <membership defaultProvider="[TBD]">
  20:        <providers>
  21:          <clear />
  22:        </providers>
  23:      </membership>
  24:      <profile defaultProvider="[TBD]">
  25:        <providers>
  26:          <clear />
  27:        </providers>
  28:      </profile>
  29:      <httpModules>
  30:        <remove name="Cms" />
  31:      </httpModules>
  32:      <siteMap defaultProvider="[TBD]">
  33:        <providers>
  34:          <clear />
  35:        </providers>
  36:      </siteMap>
  37:      <healthMonitoring>
  38:        <eventMappings>
  39:          <remove name="Simple Web Request Event" />
  40:        </eventMappings>
  41:        <providers>
  42:          <remove name="Simple Web Event Provider" />
  43:          <remove name="Simple Web Buffered Event Provider" />
  44:        </providers>
  45:        <rules>
  46:          <remove name="SitefinityEventHandler" />
  47:          <remove name="SitefinityErrorHandler" />
  48:        </rules>
  49:      </healthMonitoring>
  50:    </system.web>
  51:  </configuration>

There's a few optional sections in here. roleManager, membership, and profile are only necessary if you are using them, but if you are, you need to provide a different defaultProvider attribute value, since SiteFinity uses a specific one that won't be available to your sub-application. So either delete the sections or change [TBD] to be your provider (which you'll have to add in the providers section).

Tags: | |

Categories: Development, Software, C#