Products and Services
Graffiti CMS
Learn more about our simple content publishing platform.
Harvest Reporting Server
Get business intelligence tools for measuring online behavior.
Professional Services
Consulting, creative, and Web services from the people who know Community Server best.
Solutions
Telligent
Learn more about our team at Telligent.com.
 

Adding New Pages to Themes

The SiteUrls.config file defines all of the rewritten URLs within Community Server.

You can use the SiteUrls_Override.config file within the root of the Community Server installation to customize the base SiteUrls.config file without changing the file contents.  Using the SiteUrls_Override.config file to modify the SiteUrls.config file will make upgrading to future versions of Community Server easier.

To add a new page to a theme, add the page to SiteUrls_Override.config.

Each sub-folder within Community Server is represented by a <location /> node within the SiteUrls.config file.  You can use the SiteUrls_Override.config file to insert a page within an existing sub-folder, as shown in the following example:

<?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>

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

The following example shows how you can locate the SiteUrls_Override.config file within a new subfolder:

<?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>

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

In both examples above, you set the following properties:

  • Name - Name of the URL which can be used as the UrlName on the <CSControl:SiteUrl /> control to generate links to this new URL.
  • path - 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 - Should be set to "##themeDir##" because this is a themed page.
  • 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 -- Represents the name of the ASPX file within the <location />s themeDir in the current theme that implements the UI of this <url />.

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. 

You can copy and modify an existing page as needed.