Adding Front Page News to CS 2.1
If you recently upgraded to Community Server 2.1 from 2.0 and would like to have the recent blogs posts and whos online back on the home page like it use to be then all you need to do is add the code in red below to your default.aspx file which can be found in the root folder of your Community Server site.
<%@ 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" %>
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs
e)
{
UsersOnline.SetLocation("Home");
MyForums.Visible =
ApplicationSet.Applications[ApplicationType.Forum].Enabled;
ActivePosts.Visible =
ApplicationSet.Applications[ApplicationType.Forum].Enabled;
UnansweredPosts.Visible =
ApplicationSet.Applications[ApplicationType.Forum].Enabled;
AggregateGalleryPosts.Visible =
ApplicationSet.Applications[ApplicationType.Gallery].Enabled;
}
</script>
<CS:MPContainer runat="server"
id="Mpcontainer1" ThemeMasterFile = "HomeMaster.ascx" >
<CS:MPContent id="bcr" runat="server">
<div
class="CommonContentArea">
<div class="CommonContent">
<CS:AdPart runat
= "Server" contentname="StandardTop" >
<CS:Ads Zone="StandardTop" runat="server" id="Ads1"
/>
</CS:AdPart>
<CS:ContentPart runat =
"Server" contentname="welcome" id = "welcomeContentPart"
text="<p><IMG src="utility/images/cs-home-1.gif"><br
/><div
style="padding-left:75px;"><p><a href="http://communityserver.org/r.ashx?3"
target="_blank">Community Server</a> is
the award winning platform for quickly and easily creating online communities
and has all the integrated tools, such as: discussion forums, blogs, photo
galleries, file galleries, search, RSS tools, content management, advanced user
permissions required for building
communities.</p><p><a href="http://communityserver.org/r.ashx?3"
target="_blank">Community Server</a> also
supports a number of add-ons and gateways that enable additional functionality
such as: single sign-on modules, posting to your blog through email, the ability
to post and reply to forums through email, and file management tools for easy
drag-and-drop management of your file or photo gallery. You can learn more about
these add-ons and others at <a href="http://communityserver.org/r.ashx?3"
target="_blank">communityserver.org</a>.</p>
<IMG src="utility/images/showcase.gif"><br
/><a title="MSNBC Cosmic Log" href="http://cosmiclog.msnbc.msn.com"><IMG
border=0 src="utility/images/showcase-4.gif"></a>
<a title="Mix06 Conference" href="http://mix06.com"><IMG
border="0" src="utility/images/showcase-1.gif"></a>
<a title="Hive.NET" href="http://hive.net"><IMG
border="0" src="utility/images/showcase-2.gif"></a>
<a title="Gearlog.com" href="http://gearlog.com"><IMG
border="0" src="utility/images/showcase-3.gif"></a>
<a title="Major Nelson" href="http://majornelson.com"><IMG
border="0" src="utility/images/showcase-5.gif"></a>
<IMG src="utility/images/awards.gif"><p><IMG src="utility/images/telligent.gif"><br
/><a href="http://communityserver.org/r.ashx?2"
target="_blank">Telligent</a>, the
company who builds, maintains, supports, and licenses the Community Server
platform, is a full service Microsoft .NET solutions
company.</div></p><p><IMG src="utility/images/cs-home-2.gif"><div
style="padding-left:75px;"><a href="http://communityserver.org/r.ashx?3"><b>CommunityServer.org</b></a>
- The community for Community Server. The best place to start!<br
/><a href="http://communityserver.org/files/folders/513585/download.aspx"><b>Licensing
& Add-ons</b></a> - Details on licensing and
additional features for your Community Server system.<br
/><a href="http://docs.communityserver.org"><b>User
documentation</b></a> - Includes how-tos and
explanations for Community Server features.<br /><a href="http://communityserver.org/blogs/videos/default.aspx"><b>How
to Videos</b></a> - Watch an ever growing list of
videos about Community Server.<br /><a href="http://telligent.com/contact/"><b>Support,
development, and hosting</b></a> - Contact Telligent
for support, as well as hosting and custom development
recommendations.<p>Other useful resources:<br
/><a href="http://communityserver.org/blogs/announcements/default.aspx"><b>Community
Server Announcements Blog</b></a> - Subscribe and
keep up-to-date with the latest announcements.<br /><a href="http://communityserver.org/blogs/dailynews/default.aspx"><b>Community
Server Daily News Blog</b></a> - Subscribe and get
daily updates about Community Server.<br /><a href="http://developer.communityserver.org"><b>Software
Developer Wiki</b></a> - Basic developer
documentation.</p></div><br
/></p>' />
</div>
<div
class="CommonContent">
<Blog:AggregatePostList runat="Server" PageSize=5 id="AggregateBlogPosts"
EnablePaging="false" EnableTitle="false">
<SkinTemplate>
<h2
class="CommonTitle">
<asp:Literal runat="server" id="title" />
</h2>
<Blog:AggregateList id="Posts" runat="Server" EnableTitle="false"/>
</SkinTemplate>
</Blog:AggregatePostList>
<CS:WhoIsOnline runat="server" id="Whoisonline1"/>
<CS:AdPart runat = "Server"
contentname="StandardBottom" ID="Adpart2">
<CS:Ads
Zone="StandardBottom" runat="server" id="Ads3" />
</CS:AdPart>
</div>
</div>
</CS:MPContent>
<CS:MPContent id="rcr"
runat="server" >
<div
class="CommonSidebar">
<CS:ContentPart runat = "Server" contentname="featured" id =
"featuredContentPart" text="<div
class="CommonSidebarArea"><h4
class="CommonSidebarHeader">Featured
Item</h4><div
class="CommonSidebarContent">Content Management is easy
in Community Server! <p>Sign-in with your Admin account and
double-click to edit
me!</p></div></div>" />
<CSD:ThreadRepeater runat="server" ThreadViewMode="MyForums"
id="MyForums">
<HeaderTemplate>
<div class="CommonSidebarArea">
<h4
class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3"
AnchorType="MenuMyForums" runat="server" ShowIcon = "false"
ID="Forumanchor3"/></h4>
<div class="CommonSidebarContent">
</HeaderTemplate>
<ItemTemplate>
<div class="CommonSidebarContentItem">
<a
title="<%# ( ForumConfiguration.Instance().EnablePostPreviewPopup &&
CSContext.Current.User.Profile.EnablePostPreviewPopup ?
Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem,
"Body").ToString()), 300) : String.Empty )%>"
href="<%# Globals.GetSiteUrls().Post( (int)
DataBinder.Eval(Container.DataItem, "PostID") ) %> ">
<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem,
"Subject").ToString(), 22) %>
</a>
</div>
</ItemTemplate>
<FooterTemplate>
</div>
</div>
</FooterTemplate>
</CSD:ThreadRepeater>
<CSD:ThreadRepeater
runat="server" ThreadViewMode="Active" id="ActivePosts">
<HeaderTemplate>
<div class="CommonSidebarArea">
<h4
class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3"
AnchorType="PostsActive" runat="server" id="Forumanchor1" /></h4>
<div
class="CommonSidebarContent">
</HeaderTemplate>
<ItemTemplate>
<div
class="CommonSidebarContentItem">
<a title="<%# (
ForumConfiguration.Instance().EnablePostPreviewPopup &&
CSContext.Current.User.Profile.EnablePostPreviewPopup ?
Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem,
"Body").ToString()), 300) : String.Empty )%>"
href="<%# Globals.GetSiteUrls().Post( (int)
DataBinder.Eval(Container.DataItem, "PostID") ) %> ">
<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem,
"Subject").ToString(), 22) %>
</a>
</div>
</ItemTemplate>
<FooterTemplate>
</div>
</div>
</FooterTemplate>
</CSD:ThreadRepeater>
<CSD:ThreadRepeater ThreadViewMode="Unanswered" runat="server"
id="UnansweredPosts">
<HeaderTemplate>
<div class="CommonSidebarArea">
<h4
class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3"
AnchorType="PostsUnanswered" runat="server" id="Forumanchor2"
/></h4>
<div class="CommonSidebarContent">
</HeaderTemplate>
<ItemTemplate>
<div class="CommonSidebarContentItem">
<a
title="<%# ( ForumConfiguration.Instance().EnablePostPreviewPopup &&
CSContext.Current.User.Profile.EnablePostPreviewPopup ?
Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem,
"Body").ToString()), 300) : String.Empty )%>"
href="<%# Globals.GetSiteUrls().Post( (int)
DataBinder.Eval(Container.DataItem, "PostID") ) %> ">
<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem,
"Subject").ToString(), 22) %>
</a>
</div>
</ItemTemplate>
<FooterTemplate>
</div>
</div>
</FooterTemplate>
</CSD:ThreadRepeater>
<Galleries:AggregatePortalPictureListing EnableTitle="false" Count="5"
SortBy="ThreadDate" runat="server" ID="AggregateGalleryPosts"/>
</div>
</CS:MPContent>
</CS:MPContainer>
Similar Posts
- Display Specific Blog or Blog Group Posts
- Community Server 2.1 SP1 Released!
- Community Server 2.1, Service Pack 2 Released
