HowTo: Customize Community Server navigation

InfoDabble > Tech Notes > HowTo > Portal > HowTo: Customize Community Server navigation
Jump to: navigation, search

By Eric Hartwell - last updated March 19, 2006


Community Server 2.0 was designed to be customized and extended, so it's extremely easy to add links to other site components to the navigation tab bar.

Tab Bar

The site's addresses are specified in SiteUrls.config, and XML text file at the root of the Community Server installation. The navigation links are specified in the <navigation> section, or the format:

<link name="name" resourceUrl="url" resourceName="text" roles="roles" />
<link name="name" navigateUrl="url" text="tabtext" />
name
look up value (identifier)
resourceUrl
maps to url name in SiteUrls/Urls
navigateUrl
fixed, absolute URL
resourceName
Text for link/tab. Maps to the language resource files
text
Text for link/tab, single language
roles
Which users can view this link. If no roles attribute is given, it will assume it is for Everyone. You can specify multiple roles by separating them with a comma

The Siteurls.config for my site looks like this (with changes highlighted):

  1. <navigation>
  2. <!--
  3. name: look up value
  4. resourceUrl: maps to url name in SiteUrls/Urls
  5. resourceName: text for link. Maps to the language resource files
  6. roles: Which users can view this link.
  7. If no roles attribute is given, it will assume it is for Everyone. You can
  8. specify multiple roles by separating them with a comma (,).
  9.  
  10. You can also specify actual links here like the following:
  11. link name="mylink" navigateUrl="http://www.mysite.com/" text="My Link"
  12. -->
  13. <!-- link name="home" resourceUrl="home" resourceName="home" roles="Everyone" / -->
  14. <link name="home" navigateUrl="http://www.ehartwell.com/" resourceName="home" roles="Everyone" />
  15. <link name="mywiki" navigateUrl="http://www.ehartwell.com/wiki" text="Wiki" />
  16. <link name="blog" navigateUrl="http://ehartwell.com/cs2/blogs/infodabble/default.aspx" text="Blog" />
  17. <link name="myarchive" navigateUrl="http://www.ehartwell.com/BlogArchive/index.htm" text="Archive" />
  18. <link name="blogs" resourceUrl="webloghome" resourceName="weblogs" roles="Everyone" applicationType = "Weblog" />
  19. <link name="forums" resourceUrl="forumshome" resourceName="forums" roles="Everyone" applicationType = "Forum" />
  20. <link name="gallery" resourceUrl="galleryhome" resourceName="photos" roles="Everyone" applicationType = "Gallery" />
  21. <link name="files" resourceUrl="fileshome" resourceName="files" roles="Everyone" applicationType = "FileGallery" />
  22. <link name="reader" resourceUrl="readerhome" resourceName="reader" applicationType = "FeedReader"
  23. type ="CommunityServer.Reader.Controls.ReaderMenuValidator, CommunityServer.Reader" />
  24. <link name="roller" resourceUrl="rollerhome" resourceName="roller" applicationType = "BlogRoller" />
  25. <link name="controlpanel" resourceUrl="controlpanel" resourceName="controlpanel"
  26. roles="SystemAdministrator,BlogAdministrator,ForumsAdministrator,Moderator,GalleryAdministrator,
  27. FileAdministrator,ReaderAdministrator,MembershipAdministrator" />
  28. <link name="mytechnotes" navigateUrl="http://www.ehartwell.com/TechNotes/index.htm" text="Tech Notes" />
  29. <link name="myapollo17" navigateUrl="http://www.ehartwell.com/Apollo17/index.htm" text="Apollo 17" />
  30. <link name="myabout" navigateUrl="http://www.ehartwell.com/About/index.htm" text="About me" />
  31. </navigation>

Footer

Unlike most other parts of the application, the Community Server footer is not designed to be easily customized. This is largely a licensing issue:

The Express Edition of Community Server is recommended for organizations or individuals that want to quickly and easily (on a budget) create a community site. It includes fully functional blogs, forums, and photo gallery tools. However, it is limited in that add-ons cannot be used and it has a required “Power By” advertisement in the footer of every page.

However, provided you don't violate the license agreement, you can customize the footer by editing the theme's Master.ascx file. Comment out Community Server's <CS:Footer> code, and replace it with the HTML from the shared border we already built for the FrontPage part of the site - plus the "Powered By Community Server" advertisement, of course. The Master.ascx looks like this (with changes highlighted):

  1. <div id="CommonBody">
  2. <table cellspacing="0" cellpadding="0" border="0" width="100%" id="CommonBodyTable">
  3. ...
  4. ...
  5. </table>
  6. </div>
  7. <!--
  8. <div id="CommonFooter">
  9. <CS:MPRegion id="BodyFooterRegion" runat="server" >
  10. <CS:Footer runat="server" id="Footer1"/>
  11. </CS:MPRegion>
  12. </div>
  13. -->
  14. <div id="CommonFooter" style="font-size: 9px">
  15. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  16. <tr>
  17. <td nowrap width="108">
  18. <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">
  19. <img alt="Creative Commons License" border="0" src="/images/somerights20.png" hspace="10" width="88" height="31"></a>
  20. </td>
  21. <td nowrap align="left">
  22. Unless otherwise noted, all material by <a href="http://www.ehartwell.com/">Eric Hartwell</a> is licensed under <br>
  23. the <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</a>
  24. </td>
  25. <td width="90%">
  26. &nbsp;
  27. </td>
  28. <td>
  29. <a href="http://communityserver.org/r.ashx?1"><img border=0 hspace="10" width="114" height="40" src="/cs2/images/EULA.gif" /></a>
  30. </td>
  31. </tr>
  32. </table>
  33. </div>
  34. </div>
  35. </CS:MPRegion>
  36. </CS:MPForm>
  37. </body>
  38. </html>

Next Step: Customize FrontPage Navigation and Skin


Revision History
  • 20060319 - Added footer
  • 20060316 - Initial version