Jan 27 2006

Add a Custom Link in CS 2.0 Beta 3

Category:Bil@l @ 16:37

In reference to a post on the http://www.communityserver.org forums, on how to create a custom section in CS 2.0 beta 3, I decided to write this post here.

1- Open SiteUrls.config, in the Locations section, add the following no matter where you places them preferably before the weblogs location.:

     <location name="CustomPage" path="/CustomSection/" exclude="true" />

2- In the Navigation section, add the following according to your own order you want:

      <link name="CustomPage" text ="Custom Link" navigateUrl="/cs/CustomSection" />

You must be aware that I have installed CS on http://localhost/cs

3- Create a new folder called CustomSection inside the web folder.

4- Add a page called default.aspx page.

5- Now you want to show some content on the page right? You need to follow a certain Master usercontrol. Go to /Themes/default/Masters/ create a new text file name it CustomPage.ascx.

6- Open the HomeMaster.ascx usercontrol, copy its content and paste them in the new CustomPage.ascx.

6- Make sure you change the following line in the CustomPage.ascx:

<CS:SelectedNavigation Selected = "Home" runat="Server" id="Selectednavigation1" />

Make sure you remove the word Home and replace it with the name of the custom location in SiteUrls.config, and in this case, rename it to: CustomPage. This is done so that, once you are in the Custom Section, its link will be highlighed to differentiate where you are now.

7- Now that you created the Master control, you need to open the default.aspx page in the root folder i.e. (/cs/default.aspx), copy its content and paste it in the default page inside (/cs/CustomSection). You can use the code below to show all the different available sections inside a page, that you can have, at least that is what I was able to find out.

<%@ Page SmartNavigation="False" Language="C#"  enableViewState = "false" %>
<%@ Register TagPrefix="CSD" Namespace="CommunityServer.Discussions.Controls" Assembly="CommunityServer.Discussions" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="Galleries" Namespace="CommunityServer.Galleries.Controls" Assembly="CommunityServer.Galleries" %>
<%@ Register TagPrefix="Blog" Namespace="CommunityServer.Blogs.Controls" Assembly="CommunityServer.Blogs" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Discussions.Components" %>
<%@ Import Namespace="CommunityServer.Blogs.Components" %>
<%@ Import Namespace="CommunityServer.Galleries.Components" %>

<CS:MPContainer runat="server" id="Mpcontainer1" ThemeMasterFile = "CustomMaster.ascx" >

 <CS:MPContent id="lcr" runat="server" >
  <div class="CommonSidebar">
   <cs:ContentPart runat = "Server" contentname="featuredLCP" id = "featuredContentPartLCP">
    <div class="CommonSidebarArea">
     <h4 class="CommonSidebarHeader">Left Area
     <div class="CommonSidebarContent">
      <p>You Place the Left Side content here!!</p>
     </div>
    </div>
   </cs:ContentPart>
             </div>
 </CS:MPContent>

 <CS:MPContent id="bcr" runat="server">
  <div class="CommonContentArea">
   <div class="CommonContent">
   <cs:ContentPart runat = "Server" contentname="welcomeBCP" id = "welcomeContentPartBCP"
      text="<h2 class='CommonTitle'>Welcome to Community Server! </h2><IMG src='http://communityserver.org/utility/images/showcase_sites.gif' align=right> <a href='http://communityserver.org/r.ashx?3' target='_blank'>Community Server</a> is the award winning platform that enables you to quickly and easily create online communities. <p>Community Server is a collaboration platform and includes: discussions, blogs, content management, photo gallery, file gallery, user management tools, advanced permissions system, extensible theme engine, and much more.</p><p>Community Server is a shared source platform developed, maintained, supported-by, and licensed by <a href='http://communityserver.org/r.ashx?2' target='_blank'>Telligent</a>. Telligent additionally offers services for helping customize, host, and manage your Community Server system.</p>" />
   </div>
  </div>
 </CS:MPContent>

 <CS:MPContent id="rcr" runat="server" >
  <div class="CommonSidebar">
   <cs:ContentPart runat = "Server" contentname="featuredRCP" id = "featuredContentPartRCP">
    <div class="CommonSidebarArea">
     <h4 class="CommonSidebarHeader">Right Area
     <div class="CommonSidebarContent">
      <p>You Place the Right Side content here!!</p>
     </div>
    </div>
   </cs:ContentPart>
             </div>
 </CS:MPContent>
 <CS:MPContent id="BodyFooterRegion" runat="server" >
  <div class="CommonSidebar">
   <cs:ContentPart runat = "Server" contentname="featuredFCP" id = "featuredContentPartFCP">
    <div class="CommonSidebarArea">
     <h4 class="CommonSidebarHeader">Footer Area</h4>
     <div class="CommonSidebarContent">
      <p>You Place the Footer content here!!</p>
     </div>
    </div>
   </cs:ContentPart>
             </div>
 </CS:MPContent>
</CS:MPContainer>

At least this will show you a page similar to the one here.

Hope this helps you out. I am always ready for any comment or question. Above all, if you guys from CS team find anything wrong, or anything can be improved in my post to make creating custom sections in CS esay, please do comment or contact me directly.

Thank you all,
A special thanks to Scott Watermasysk

Regards

Tags:

Comments are closed