To add a new page to a theme in CS2007,

  1. Add the page to SiteUrls_Override.config

    The SiteUrls.config file defines all of the rewritten URLs within Community Server.  The SiteUrls_Override.config file within the root of the Community Server installation can be used to customize the base SiteUrls.config file without changing the files contents.  While changing the SiteUrls.config file directly is supported, using the SiteUrls_Override.config file to modify the SiteUrls.config file will make upgrading to future versions of Community Server easier.

    Each sub-folder within Community Server is represented by a <location /> node within the SiteUrls.config file.  To insert a page within an existing sub-folder, the following SiteUrls_Override.config file could be used:

    <?xml version="1.0" encoding="utf-8" ?>
    <Overrides>
       <Override xpath="/SiteUrls/locations/location[@path='/blogs/']" mode="add">
          <url name="custom_newcontact" path="contact.aspx" pattern="contact.aspx" physicalPath="##themeDir##" vanity="{2}" page="newcontact.aspx" />
       </Override>
    </Overrides>


    which would add support for redirecting /blogs/contact.aspx to the themed page /themes/[theme name]/blogs/newcontact.aspx

    If the file should be located within a new subfolder, the following SiteUrls_Override.config file could be used:

    <?xml version="1.0" encoding="utf-8" ?>
    <Overrides>
       <Override xpath="/SiteUrls/locations" mode="add">
          <location name="newcontact" path="/contact/" themeDir="contact">
             <url name="custom_newcontact" path="default.aspx" pattern="default.aspx" physicalPath="##themeDir##" vanity="{2}" page="newcontact.aspx" />
          </location>
       </Override>
    </Overrides>


    which would add support for redirecting /contact/default.aspx to the themed page /themes/[theme name]/contact/newcontact.aspx

    In both examples, the following properties are set:

    • name -- the name of the URL which can be used as the UrlName on the <CSControl:SiteUrl /> control to generate links to this new URL.
    • path -- the path is used to format the URL through controls such as <CSControl:SiteUrl />
    • pattern -- when matching a request, the pattern (which supports RegEx syntax) is used to detect if the requested URL matches the <url />
    • physicalPath -- because this is a themed page, physicalPath should be set to "##themeDir##"
    • vanity -- vanity defines the reformatting of the requested URL (which can use RegEx matches from the pattern attribute) to the local URL.  For themed pages, {2} will identify the page within the <location />s themeDir.
    • page -- page represents the name of the ASPX file within the <location />s themeDir in the current theme that implements the UI of this <url />
  2. Create the themed page

    The page within the theme referenced by the new <url /> record should now be added to each supported site theme.

    The new page should define an appropriate master page and content, as necessary, for each content region exposed by the selected master page. 

    An existing page can be copied and modified as needed.