The _Override.config architecture in Community Server is a sweet thing, allowing customization of both the CommunityServer.config and SiteUrls.config without touching the source files. Using the XPath Override logic is usually pretty straightforward, but sometimes it can get a little tricky. Today I wanted to create a new SiteUrl location in a SiteUrls_Override.config file, a Nuglet Worthy endeavor because I couldn't find another example of it anywhere.
What I mean by "location" is that the SiteUrls.config file contains several "location" areas: Blogs, Forums, Media, etc., each typically mapped to a corresponding /themes/[SomeTheme]/[Folder]. I needed to create a number of new pages, but rather than add them in /Common or some other existing folder I wanted to place them in their own theme subfolder, which I'm calling "Shared."
This is how I added the new location in the SiteUrls_Override.config.
<Override xpath="/SiteUrls/locations/location" mode="update" where="end">
<location name="shared" path="/" themeDir="Shared" >
<url name="shared_Calendar" path="" pattern="calendar.aspx"
physicalPath="##themeDir##" vanity="{2}" page="calendar.aspx" />
<url name="shared_Maps" path="" pattern="maps.aspx"
physicalPath="##themeDir##" vanity="{2}" page="maps.aspx" />
.....
</location>
</Override>
The resulting pages would be stored in /themes/mytheme/Shared with the urls
http://mysite.com/calendar.aspx
http://mysite.com/maps.aspx