jdc:We modified the Recent threads content area so
it shows only posts in a single forum (announcements)
We modified the title of the tag cloud content
area
Organizing the
sidebar - conceptual overview
We wanted to accomplish the following with our sidebar
- Remove the default, out-of-box content (docs,
vendors, etc.)
- Have several rounded-rectangle areas of our own
content
- A welcome message that is only seen by visitors
- A featured item
- A list of posts made only to our Announcements
forum
- A tag cloud
- We wanted to adjust the way that content part
formatting was done
- Decrease heading font size and increase text font
size
- Avoid accidental removal of rounded rectangle
formatting
-
When admins edited the welcome-featured content
part, they’d often accidentally remove the rounded-rectangle formatting
-
We decided it would be better if each content
part in the sidebar had the rounded-rect formatting OUTSIDE the editable content
area (so admins couldn’t hurt it).
Removing the default
verbiage
- Open the /themes/default/common/home.aspx file
- Find <CSControl:ContentPart ContentName="featured-default"
runat="server"
ContentCssClass="CommonContentPartBorderOff"
ContentHoverCssClass="CommonContentPartBorderOn">
- This is the code that starts the one big sidebar
content part in the sidebar
- Note that the first major <div class="CommonSidebarArea"></div> area
contains the “Sign-in with your Admin…” text – this is fine, leave it.
- There are several other major <div class="CommonSidebarArea">
sections which follow
- First has documentation link
- Second has vendor links
- Third has books
- Fourth has hosts
- We deleted them all!!
- Save your file…this leaves you with a single
rounded rectangle for featured item in the sidebar
Adding rounded rectangle
content areas
Rather than include multiple areas within a single content
part (as CS does out of the box), we decided to use separate content parts for
each (makes sense given the changes in rounded-rect formatting we implement
below).
- Still working in the
/themes/default/common/home.aspx
- Find <CSControl:ContentPart ContentName="featured-welcome" runat="server" ContentCssClass="CommonContentPartBorderOff"
ContentHoverCssClass="CommonContentPartBorderOn">
- Copy the entire <CSControl:ContentPart ContentName="featured-test"
runat="server"
ContentCssClass="CommonContentPartBorderOff"
ContentHoverCssClass="CommonContentPartBorderOn"></CSControl:ContentPart> block,
and paste a copy right below
- Change the ContentName (e.g. ContentName="featured-visitor" )
- Save your file…now when you load the page your have
multiple contentparts that are easily editable by the administrator
Showing a contentpart
for only certain users
- Still working in the
/themes/default/common/home.aspx
- Find the beginning of the contentpart you wish
to show only to a particular role (e.g. <CSControl:ContentPart ID="ContentPart2" ContentName="visitor-default" runat="server" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn"> )
- On the next line, enter the following code…
<DisplayConditions><CSControl:UserInRoleCondition UseAccessingUser="true"
Role="Visitor"
runat="server"
/></DisplayConditions>
- This “filters” the contentpart, showing it only
to people in the Visitor role
Showing a list of
posts from a single forum
We didn’t want to show all recent posts, just those made to
our Announcements forum. Also, we wanted to have them show only for registered
users. To do this, we did the following…
- Still working in the
/themes/default/common/home.aspx
- After the featured-default contentpart, we
entered the following code (forgive the lack of indenting – can’t quite figure
out how to post code here easily)…
<CSForum:ThreadList ID="ThreadList-homepage"
runat="server">
<DisplayConditions>
<CSControl:UserInRoleCondition UseAccessingUser="true" Role="Registered Users" runat="server" />
</DisplayConditions>
<QueryOverrides GroupID="6" ForumID="7" PageSize="5" />
<HeaderTemplate>
<div class="CommonSidebarArea">
<div class="CommonSidebarRoundTop">
<div class="r1"></div>
<div class="r2"></div>
<div class="r3"></div>
<div class="r4"></div>
</div>
<div class="CommonSidebarInnerArea">
<CSControl:SiteUrl ID="SiteUrl1"
UrlName="post_Active"
Parameter1="-1"
ResourceName="Utility_ForumAnchorType_ActiveAnnouncements"
Tag="H4"
CssClass="CommonSidebarHeader"
runat="server"
/>
<div class="CommonSidebarContent">
<ul class="CommonSidebarList">
</HeaderTemplate>
<ItemTemplate>
<CSForum:ThreadData ID="ThreadData-homepage"
runat="server"
LinkTo="Thread"
Property="Subject"
TruncateAt="35"
Tag="Li"
/>
</ItemTemplate>
<FooterTemplate>
</ul>
</div>
</div>
<div class="CommonSidebarRoundBottom"><div class="r1"></div>
<div class="r2"></div>
<div class="r3"></div>
<div class="r4"></div>
</div></div>
</FooterTemplate>
</CSForum:ThreadList>
Note we’re using DisplayConditions again to control who see’s
the list – this time only registered users. The query override controls which
posts get shown – here we’re specifying the group and forum ids for our
announcements forum.
Adding the tag cloud
We wanted a tag cloud with a customized title and tags from
all forum and blog posts, so here’s what we did…
- Still working in the
/themes/default/common/home.aspx
- Somewhere in the sidebar (we did it after the
threadlist) enter the following code (which we copied/adapted from code in the themes/forums/forums.master
page) …
<CSControl:TagCloud ID="TagCloud-homepage"
runat="server"
TagCssClasses="CommonTag6,CommonTag5,CommonTag4,CommonTag3,CommonTag2,CommonTag1"
MaximumNumberOfTags="25"
ShowTagCounts="false"
IgnoreFilterTags="true"
TagCloudCssClass="CommonSidebarTagCloud">
<LeaderTemplate>
<div class="CommonSidebarArea">
<div class="CommonSidebarRoundTop">
<div class="r1"></div>
<div class="r2"></div>
<div class="r3"></div>
<div class="r4"></div>
</div>
<div class="CommonSidebarInnerArea">
<CSControl:ResourceControl ID="ResourceControl1"
runat="server"
ResourceName="PopularSiteTags"
Tag="H4"
CssClass="CommonSidebarHeader"
/>
<div class="CommonSidebarContent">
</LeaderTemplate>
<TrailerTemplate>
</div>
<CSControl:SiteUrl ID="SiteUrl2"
UrlName="tags_home"
ResourceName="ViewAllTags"
runat="server"
Tag="Div"
CssClass="CommonSidebarFooter"
/>
</div>
<div class="CommonSidebarRoundBottom">
<div class="r1"></div>
<div class="r2"></div>
<div class="r3"></div>
<div class="r4"></div>
</div></div>
</TrailerTemplate>
</CSControl:TagCloud>
We made a couple slight modifications to the code we
copied/pasted.
- We removed an attribute from <CSControl:TagCloud…
- We removed ApplicationType="Forum"
, which would normally limit the Tag cloud to tags from the forum posts (I
think)
- Our users might not understand what tags are, so
we changed the title to Popular Site
Topics. To do so takes several steps...
- Change <CSControl:ResourceControl ID="ResourceControl1"
runat="server"
ResourceName="PopularTags" to <CSControl:ResourceControl ID="ResourceControl1"
runat="server"
ResourceName="PopularSiteTags"
-
Create a new resource object in Web/languages/en-us/resources.xml
- Directly
under that line, enter the following: <resource
name = "PopularSiteTags">Popular Site Topics</resource>
Whew - I'm tired. I'll stop here for now, and discuss the changes to the sidebar contenpart formatting in an upcoming post.
Jeff Davis
MBA Candidate, Class of 2008
The Fuqua School of Business, Duke University
Profile: http://www.linkedin.com/in/jwdavis