Professional Community Server

Professional Community Server™ Wyatt Preul Keyvan Nayyeri José Lema Jim Martin Professional Community Server™ Pro...
Author:  Wyatt Preul |  Keyvan Nayyeri |  Jose Lema |  Jim Martin

55 downloads 3440 Views 5MB Size Report

This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!

Report copyright / DMCA form

Create an account


84

Chapter 5: Changing the Look-and-Feel After you save the Skin-Login.ascx page with the updated anchor tag, you get a new link that displays after the login section on the login page. Once again, this addition can be useful for visitors who are new to your site and want to create an account. The preceding code that was added is rendered after the login table, as shown in Figure 5-11.

Figure 5-11: Addition of Login Page Anchor

Creating Stylesheets Stylesheets are really nothing more than a plaintext file with a css extension. You should be able to create new stylesheets using an editor such as Notepad or ultra-edit. Make sure that your stylesheet is named appropriately to help identify what styles are located in it. For example, the Community Server blog stylesheet is named blog.css, which makes it very clear that the styles in the file relate to the blog portion of a site. When creating new stylesheets, you should also make sure that they are properly formed. There are validators that you can use on the Web to make sure that your stylesheet does not break any standards. The World Wide Web Consortium (W3C) offers a free CSS validation service that you can access at http:// jigsaw.w3.org/css-validator. This allows you to ensure that your stylesheets are following best practices. If you do decide to use the W3C CSS validation service, you may want to tweak some of the advanced settings so that you do not get a large amount of warnings. There are several options for choosing the type of medium that your stylesheet is targeting, such as a screen or tv. An example of a stylesheet that you may want to create for Community Server is a stylesheet that targets Internet Explorer 6 and previous versions. This can be helpful for easing the design of your site so that you can target the Internet Explorer 7 browser inside your standard stylesheets. As a result, you’re able to fix areas of your site that have issues rendering in Internet Explorer 6 without having to add extra styles and hack your way through your standard stylesheet files. To follow the previous recommendation to name a stylesheet appropriately, you should create a new file called IE6.css and place it in your themes style directory. Once you have added the new stylesheet file to your site, you can complete the following steps to add it to the header of all of the pages on your site so that it is included whenever a user accesses your site with an Internet Explorer browser that is less than or equal to version 6:

1. 2.

Log in to your site using a System Administrator account. Click the Control Panel.

85

Part II: Configuring Community Server 3. 4. 5.

Click the Administration menu. Expand the Settings menu and choose the Site Name & Description menu option. In the Raw Header field, add the following entry:



6.

Press the Save button.

Now that you have added the previous code to your site’s raw header, any time a person visits your site with Internet Explorer 6, the IE6.css file will load. In addition, the stylesheet will load last so that you can override any other styles that are not displayed correctly in Internet Explorer 6. You can use this same strategy for targeting Internet Explorer 7 by replacing 6 with 7 in the example. This way, you can target your development toward Firefox and then fix any inconsistencies with rendering in IE7 as a separate process.

Adding Custom Images There are some important points that you should consider when adding a custom image to Community Server. First, it is helpful to make sure that your image file is small enough so that it doesn’t take visitors a long time to download it. The amount of space that your image file takes up should be balanced with the dimensions of the image while maintaining a reasonable level of quality. Usually, images that are used on web pages are of JPEG, GIF, or PNG type. There are different reasons to go with each of these image choices; here are the most common ones: ❑

JPEG is often used for images that you want to be small in file size while still providing a decent level of quality. The level of clarity and file size correlate to the compression level used to produce the image.

❑

GIF is often used for the same reasons that a JPEG image would be used. However, the important distinction is that a GIF image allows the image to be transparent, which can be useful for creating things such as rounded corners on a web page.

❑

PNG is often used for a similar reason as a GIF image, which is to allow an image to be transparent in places. The important distinction is that a PNG image will allow for alpha transparency. This basically means that an image can have varying levels of transparency. It is important to realize that if you do use a PNG image for alpha transparency that you add special lines in your stylesheet so that Internet Explorer 6 can render the PNG image correctly. All of the other popular browsers today have support for alpha transparency, including Internet Explorer 7.

In addition to choosing the most appropriate image type, it is also important to place your image in the best location in your Community Server site. Images are usually placed in one of the subfolders under the images folder of a specific theme. There are subfolders under the images folder that specify where the each of the images will be located in the site. For example, if you have an image that only relates to pages in the Control Panel, then you should place it under the controlpanel folder. Furthermore, if you have an image that will be used across all areas of the site, such as an image that is in the header of all pages, then you would place it under the images/common subfolder.

86

Chapter 5: Changing the Look-and-Feel

Changing the Default Color Scheme As a result of Community Server relying so much on CSS, it is relatively straightforward to change the default color scheme of a site. To do this, you really only need to edit stylesheet files. For example, if you want to change the colors for the main layout from the green and brown that are set by default to a red and black color scheme, you are able to do so just by editing the common.css. This new color scheme replaces all of the background colors with a black background. In addition, it replaces all of the foreground colors and borders with a red color. What the new color scheme looks like can be found in Figure 5-12.

Figure 5-12: Red and Black Color Scheme

There are a few different ways that you can achieve this same color scheme using your default editor with the common.css file open. Perhaps the easiest way is to do a find and replace, where you first replace all of the entries for black with red and then replace all of the entries for white with black. This would replace the hex value 000000 with FF002A and then replace FFFFFF with 000. Note that CSS allows for shorthand notation; shorthand 000 is equivalent to the long form of the hex value for black, 000000. After you have replaced the standard colors with these new ones, you can simply search through the common.css stylesheet, looking for any remaining colors that need to be updated to either red or black. You can repeat this pattern for any other colors that remain in the stylesheet, such as CCCCCC. Once you have finished replacing all of the colors with either the black or the red choice, you will only have to update the images with the new colors so that they fit in with the rest of the color scheme. If you do not want to edit some of the images, like the selected tab bar image, then you can simply comment them out or remove them entirely from the stylesheet. To give you an idea of what some of the updated styles will look like, they are listed as follows. Please note that an entire list of updated styles would be many pages long, which is why not every updated style was included here. When you have finished updating all of the appropriate styles, your new site should look very similar to Figure 5-13. body, html { margin: 0px; padding: 0px; color: # FF002A; font-family: Tahoma, Arial, Helvetica; background-color: #000; } #CommonLeftColumn { background-color: #000;

87

Part II: Configuring Community Server padding-bottom: 22px; } #CommonRightColumn { background-color: #000; padding-bottom: 22px; } A:LINK { color: #FF002A; } A:ACTIVE { color: #FF002A; } A:VISITED { color: #FF002A; }

Figure 5-13: Updated Color Scheme

88

Chapter 5: Changing the Look-and-Feel It is important to remember that this is just one of the many color schemes that you can choose to update a site with. Furthermore, the fact that you can change the way a site looks while only touching Cascading Style Sheet files is an important characteristic that demonstrates how flexible Community Server is. Also, realize that to fully change the color scheme of a site, you should make sure to update the images located in the default themes images folder.

Common Community Ser ver Controls Community Server offers many useful controls that you can use to add functionality to your pages. Some of these controls have already been demonstrated, such as the MPRegion control that was explored toward the beginning of this chapter. However, there are still many more controls that it can be helpful to know about when you are customizing Community Server. The list that follows is not an exhaustive one covering all of the available Community Server controls; instead, it is intended to provide a basic overview of some of the many controls available. ❑

AdPart contains the different ads that can be visible on a site. By default, the AdPart is on the top and bottom of most pages; however, it is only visible whenever ads are enabled from the Control Panel.

❑

AlphaPicker generates a list of links from A through Z to assist users in navigating large groups of information. This control is useful for things such as finding a user quickly, as it allows you to select the letter b to find data that starts with that letter. For example, if you clicked the link represented by the character B, you would get back all data that starts with the letter B.

❑

CollapsableArea is a control that acts similarly to a panel control in that it can wrap a group of children elements. The main difference is that CollapsableArea has the ability to collapse and expand as a user clicks the Collapse and Expand buttons. Also, there is an abstract CollapsableAreaBase class from which the CollapsableArea inherits.

❑

ContentPart creates an editable area on a page that stores the content of the area in the database. When users with the appropriate permissions double-click a ContentPart, they are provided with a WYSIWYG editor for changing the content that is contained in the specific ContentPart.

❑

DatePickerToggle offers a control that allows a user to more easily select a specific date from a calendar. This control serves as a wrapper for a calendar control that you can either hide or show by clicking this control.

❑

DisplayUserWelcome provides the control that shows in the top-right corner of a Community

Server site that is using a default theme. It provides the links for users to check their private messages. ❑

Editor is the control that contains the basic elements for the different types of available editors.

These editors allow a user to change content in a convenient way as this is a WYSIWYG editor. ❑

Faq is nothing more than a presentation of the frequently asked questions. If you would like to display this content on another page, you can use the Faq control to do so.

❑

Footer provides the control that displays the footer of a page. The default footer will display

the Community Server logo. Therefore, if you have purchased a Community Server license and would like to disable this logo, you can do so by editing the footer control.

89

Part II: Configuring Community Server ❑

GenericControl is nothing more than a TemplatedWebControl; it does no more and no less

than provide a way to create a templated area of a site. ❑

Head is the control that wraps the content that will be included in the HTML head tag of a page. Inside this control you will often find the Style or Script controls.

❑

InlineContentPart is similar to the ContentPart in that it allows an administrator to edit content on a page without having to leave that page. The inline editor does not display a popup window, but instead allows single lines of text to be edited easily. The default installation uses the InlineContentPart for the header and description of a site.

❑

LinkButtonPager is a basic pager control that simply posts back to the same page whenever a new page is selected. This can be useful for cutting down the number of items you return to the user on a single page by effectively splitting those items into multiple pages.

❑

LiteralOrLink is exactly what it says: it will either render a link if a hyperlink value is provided and the TextOnly mode is false, or it will render a literal text control.

❑

Logout wraps the logout functions, which can be useful for having multiple logout methods.

❑

Message is used to render an error message based on an ID that is passed through a querys-

tring. The message itself is nothing more than a title and a body. ❑

ModalLink creates a basic link that when clicked will create a new modal dialog on page.

❑

MPContainer contains various MPContent controls that are used to populate specific areas on a

master page. ❑

MPContent is used inside an MPContainer for containing a specific content area of a site that is

specified in a master page. ❑

MPForm is a control that serves as a replacement for the HTML form tag inside of master pages.

❑

MPRegion is used on a master page to specify the areas of the page that an MPContent control can populate.

❑

Pager is similar to the LinkButtonPage except that the pager does not post back to the page it

is on; instead it relies on the querystring to reload the page by providing a specific page to load. ❑

PostIcons is a control that will render a specific predefined string for a user based on his or her post rank. There are different thresholds for displaying the different text, and the text itself can be configured in the resource files.

❑

RepeaterBar is a control that is used for displaying a navigation bar of different links that can

be marked as selected or not. ❑

RepeaterPlusNone is basically like any other repeater control, except that it allows you to specify a template that will be displayed whenever there are no data to be bound. This can be useful for displaying an error message informing the user that no items were found.

❑

ResourceLabel is a control that is used to get the value for a key item in the resource files for

the given language.

90

❑

Script used in the Head control to include JavaScript files. The control will be rendered inside of an HTML head tag.

❑

SearchResults is a control that displays the result items for a given search query.

Chapter 5: Changing the Look-and-Feel ❑

SelectedNavigation is used to select a navigation item on the navigation bar that runs across

the site. An example would be that on the blogs page the selected navigation is blogs. ❑

SiteStats displays information about the number of forum posts that a site has. It also provides information relating to the most recent posts and the users who have made them.

❑

StatusMessage is used mainly in the Control Panel and can provide a success or fail message

to the user. It is often used to inform a user that settings have been saved successfully and will be updated. ❑

Style is used to include stylesheet files. This will be rendered as a link tag inside of the resulting pages head tag.

❑

TagBrowser is similar to a TagCloud, except that instead of displaying the tags in a vertical fashion, they are displayed horizontally.

❑

TagCloud is a control used for rendering a tag cloud, which is simply a representation of all of the tags in a particular section of the site.

❑

ThemedImage is a control that simply displays an image, with the image source being resolved

relative to the location of the theme the control is being used in. ❑

TitleBar is the control that appears at the top of the main pages for displaying the title of a site as well as its description.

❑

UserAttribute is a control that contains a specific user profile property that you would like to

gather from a form, such as a person’s birth year or favorite music — basically, anything that you would like to store about that user. ❑

WhoIsOnline will display statistics about the current number of users who are online. This is

often found on the bottom of the home page or in the forums part of a site. ❑

YesNoRadioButtonList is a control that renders two radio buttons for a form field, which provides the options for Yes and No.

Modifying the Look of Custom Controls Community Server allows you to modify the way that custom controls are presented to a user. These changes are usually done by editing the skin files that correspond to the appropriate control. In Community Server 2.0 and 2.1, there is a skin file that corresponds to the templated controls found in the CommunityServer.Controls namespace. As a result, the skin files located in a theme Skins directory can be edited and made to contain multiple controls. To edit the skin files and change the look of the custom Community Server controls, it is helpful if you use a tool such as Visual Studio. The important thing to remember is that these skin files can be edited just as you would edit an HTML page. This means that you can add div and image tags and other elements that you see necessary. However, before you begin editing these skin files it can be useful to try to edit the look of the control using the CSS that ship with Community Server. This is a handy solution as it allows you to simply apply the same style in future versions of Community Server without having to edit any skin file.

91

Part II: Configuring Community Server

Editing the Sidebar There are often instances where you want to add or remove content from the sidebar that appears on your site. To do this, you need to edit the default.aspx page located in the root of your site. This page adds the sidebar content to the rcr content region, which is the right content region or right sidebar. In addition, if you would like the sidebar to appear on the left, then you can change rcr to lcr. Here is what your code would look like if you changed it to lcr so that the sidebar appears on the left side of the screen.
...


The resulting Community Server home page is pictured in Figure 5-14.

Figure 5-14: Sidebar on Left Side

If you would like to add any content to or remove any content from the sidebar, you simply need to add or remove the appropriate CommonSideBarArea div inside of the default.aspx. For example, if you want to remove the active section and replace it with a list of links to external sites, you can remove the ActivePosts ThreadRepeater control and replace it with the following code:

92

Chapter 5: Changing the Look-and-Feel When you save the changes to the code and try to run the site, you will notice that there is an error from the page. This is because at the top of the default.aspx page there is a set of server-side scripts that expects there to be a control with an ID of ActivePosts. To make the page run properly, simply remove the following line from the Page_Load code at the top of the default.aspx page: ActivePosts.Visible = ApplicationSet.Applications[ApplicationType.Forum].Enabled;

After you make the previous changes, the resulting page will be rendered with the new links section and the active posts removed from the sidebar. In addition, the sidebar will appear on the left side of the page because its ID is still lcr. You can observe the result of these changes in Figure 5-15.

Figure 5-15: Links Section Added to Sidebar

Creating a Blog Theme As a result of all of the various blog theme examples and Community Server support, the process of creating a new blog has become less challenging. This is a task that will be especially easy if you understand CSS and are able to identify and find the classes of elements on a web page. Before beginning to create your own blog theme, it is usually helpful to have a basic layout in mind for your page. It is also a good idea to have both an editor for the CSS and HTML markup, as well as an image editor in order to help create the theme. In the following example, Visual Studio was used to assist in creating the CSS, and Microsoft Paint was used to create the image. The directions to create a blog theme are very similar to those for creating a sitewide theme. Therefore, you should be able to apply what you learn here about blog themes to a sitewide theme. A site theme follows the same basic steps, using an existing template and simply modifying it to meet your appearance requirements. Therefore, after you have completed this section, you should also be able to apply your knowledge to the other applications on a site, as well as the entire site itself.

93

Part II: Configuring Community Server

Use Existing Template It may not be obvious at first glance, but Community Server does provide a template to assist you in creating a blog theme. The template is the default blog theme, which comes packed with all of the various skin files and the basic layout to help get you started. Therefore, the first thing that you will want to do is to make a copy of the default blog theme and rename the copy to the name of your new theme. You can do this using File Explorer in Windows by copying and pasting the default folder in the blogs theme directory back into the directory. This will create a folder called Copy of default, which you can then rename to the name of your new theme. For this example, rename the folder to Caffeine as that is the name of the theme that will be created here. After you are done creating the new theme, File Explorer should contain the folders pictured in Figure 5-16.

Figure 5-16: Blogs Theme Folder

You have essentially created a new theme as far as Community Server is concerned. To prove this and also to begin editing your new theme, you should navigate to your blog’s Control Panel and select the option to change your blog’s presentation. When you do this, you will see the option for Caffeine listed; you can now select and then save it to use this new theme. You are now able to edit the theme directly and see the results reflected on your blog.

Edit LayoutTemplate The LayoutTemplate file in the blog theme folder contains the markup for the layout of each blog. For the purposes of this example, the LayoutTemplate also uses a local BlogMaster master page to helping control the layout. Following is the LayoutTemplate with the changes that should be made to create the new Caffeine theme: <%@ Control Language=”C#” %> <%@ Register TagPrefix=”CS” Namespace=”CommunityServer.Controls” Assembly=”CommunityServer.Controls” %> <%@ Register TagPrefix=”Blog” Namespace=”CommunityServer.Blogs.Controls” Assembly=”CommunityServer.Blogs” %>
94

Chapter 5: Changing the Look-and-Feel ThemeFolder=”~/Themes/Blogs/Caffeine/” ThemeMasterFile=”BlogMaster.ascx”>


In the previous code there are two different content regions that are used to contain the layout of the Caffeine theme. First is the bhcr, which contains the header portion of the blog theme. In this region, the BlogTitleHeader control is added so that the name of the blog will be visible in the header of a blog. In addition, the bcr content region is also specified, which contains the layout for the main body part of a page. In this region, the only control that is used is the BodyTemplate, which will contain all of the content for the pages on the blog. This is necessary in order for your blog to actually have any of the posts displayed. You should also feel free to add any other content or markup that you would like to this file as it is where the bulk of the blog theme’s layout is defined. The other main file that you can define the layout in is the BlogMaster.ascx file, which is located in the root of the Caffeine theme folder. Here is an example of what the BlogMaster.ascx file should look like in order to create the Caffeine theme: <%@ Control Language=”C#” %> <%@ Import Namespace=”CommunityServer.Components” %> <%@ Register TagPrefix=”CS” Namespace=”CommunityServer.Controls” Assembly=”CommunityServer.Controls” %> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8”>

95

Part II: Configuring Community Server The previous BlogMaster master page serves as a wrapper to the LayoutTemplate file defined previously. As you can see in the previous code, the rcr, or right content region, is defined but is empty. The reason for this is so that the sidebar does not have any content in it. This prevents the child LayoutTemplate page from including any content in this area of the blog. If you would like to add any sidebar controls, you should feel free to do so by adding the controls in the rcr content region. Another important thing to notice is that the selected navigation control specifies that the navigation bar should have the link to the blogs selected. However, the theme itself will not include this navigation bar; therefore, you can omit the line entirely. It was included here as a best practice, so that whenever a navigation menu of some sort is added to the theme, the correct option will be selected. In addition, the Head Community Server control is also included in the previous code. This defines the content that will be placed inside the HTML head tag whenever the page is fully rendered in the browser. The default theme includes the common.css stylesheet inside the head tag. However, because the Caffeine theme does not depend on any of the common site styles, this entry has been removed from the head. As a result, whenever the page is fully rendered, there will be only two stylesheets that are included. The two stylesheets that are included in the head are the print.css and style.css stylesheets, which can both be found in the theme’s style directory. This is a nice feature of Community Server blog themes because by default a theme will link to these two stylesheets.

Editing Style.css Now that you have the basic layout and master page defined for the new theme, you really only have a couple of tasks left before it is displayed properly. The first of these tasks is to create a new image that will be displayed at the top of the blog theme. To help energize the theme, a picture of a caffeine molecule was selected for inclusion in the page. This will be the only custom image that the new theme requires in order to be rendered properly. You can use any image you would like to display in the header, but to make it match the rest of the theme you should edit its background so that it is black like the other part of theme will be. Furthermore, you should also make sure to create a new directory for your image, called images, which is located off the root caffeine directory. The image that is used in the Caffeine theme is called caffeine-molecule.gif and was placed in this images folder, the result of which is shown in Figure 5-17.

Figure 5-17: Caffeine Molecule Image

Once you have your new image in place, it is time to begin editing the style.css stylesheet. In normal circumstances, you would also proceed by editing the print.css stylesheet, which is used for rendering a blog to a print medium. On the other hand, the style.css stylesheet is used for rendering a blog to a screen medium. To begin, open the style.css file located in the style subfolder of the caffeine theme directory, using your Cascading Style Sheet editor of choice. Once you have the style.css file open, you should enter the following styles and save the file:

96

Chapter 5: Changing the Look-and-Feel

body, html { margin: 0; padding: 0; color: #fff; font-family: Tahoma, Arial, Helvetica; background-color: #000; } a, a:visited, a:link { color: Red; } a:hover { color: #fff; } #CommonOuter { width: 956px; margin-left: auto; margin-right: auto; } #Common { border: 1px solid red; border-bottom: solid 6px red; border-top: solid 6px red; margin-bottom: 7px; padding-bottom: 5px; } .CommonTitle { font-size: 200%; background: #000 url(../images/caffeine-molecule.gif) no-repeat top right; width: 100%; height: 200px; margin-bottom: -40px; text-indent: 30px; font-family: Georgia; } .CommonTitle a, .CommonTitle a:link, .CommonTitle a:hover, .CommonTitle a:visited { text-decoration: none; } #CommonBodyColumn

97

Part II: Configuring Community Server { padding-left: 10px; padding-right: 10px; } #CommonCommentForm textarea, #CommonCommentForm input { width: 400px; } #CommonFooter { padding-left: 40%; }

As you can see in the previous stylesheet, there are only three colors that are used. The foreground text color is white, the link text and borders are red, and the background is black. One of the important aspects in the previous code is the inclusion of the caffeine molecule as the background image. As you can see, this is done through the stylesheet so that none of the page markup needs to be changed. Another important style to look at is the input and textarea of the #CommonCommentForm being declared to have a width of 400 pixels. This is important as the default width of these two elements makes the comment area very small. The result of the previous combination of styles is pictured in Figure 5-18.

Figure 5-18: Caffeine Blog Theme

Deploying the Theme To use the new blog theme on a remote web site, you need to deploy it to the site. Fortunately, Community Server makes this process easy to perform even for a novice user because Community Server will automatically detect new blog themes that are added to the blog theme directory. As a result, to deploy your new theme to a remote site you only need to be able to FTP to the blog themes folder and have write access. Here are the basic steps that you can follow in order to deploy the Caffeine theme that was created previously to a fictitious site called Endless Energy:

1. 2.

98

Ensure that the caffeine theme is functioning correctly in a test or development environment. FTP to the Endless Energy site using an FTP client such as SmartFTP.

Chapter 5: Changing the Look-and-Feel 3. 4. 5.

Navigate to the blog’s theme directory on the remote site using the FTP client. Upload the entire Caffeine folder to the blog themes directory. Test the site by changing the theme of a blog in Endless Energy to use the new Caffeine theme.

Once you uploaded your new theme, you can disconnect the FTP client from the remote site. In addition, it is also a good idea to make a backup copy of your new theme. If you have a version control system, you can easily do this by checking in the new theme so that it will be versioned.

Using the Theme To use the theme, your site users will only need to select it from the list of available blog themes. The theme will be automatically detected by Community Server whenever the caffeine directory is created in the blog theme folder (see Figure 5-19). Therefore, to use the theme, you simply need to select the Caffeine theme and then click Save.

Figure 5-19: Selecting Caffeine Theme

Packaging the Theme for Distribution After creating a new blog theme, you most likely want to share it with the rest of the world. In order to do this, there are a few things that you should do to prepare it for global distribution. First, create a screenshot of the blog theme in action. This means that you should capture an image of your site using the theme. Once you have a screenshot, make sure to save it as a PNG image file and place it in the blog theme folder. You will notice that there is already a PNG file in the root of your blog theme folder that should be named [email protected]. This is the image that will be displayed in the preview box whenever you select the theme from the drop-down list when changing the look of a blog. Therefore, you should overwrite this image with your screenshot and name it [email protected] to match the name of your blog theme.

99

Part II: Configuring Community Server In addition, you should rename the [email protected] file to [email protected] so that it can be included in the description of the blog whenever it is selected on the blog theme selection page. After you have renamed this file, you should edit it with Notepad or an HTML editor and change the content to reflect your description of the blog. In order to describe the Caffeine theme blog, here is what the [email protected] file should look like:

Here is a Minimalist Caffeine Theme.
It features the molecule structure of caffeine and is very simple.

For more skin options see communityserver.org



Once you have made these changes, you are ready to package your theme into a compressed format for easy distribution online. Most often these themes are distributed as either a ZIP or RAR package. You can use a tool such as WinRar to create either one of these packages from your blog theme folder. In the caffeine example, you would compress the entire Caffeine folder using one of these types of compression. After you have prepared and packaged your new theme, it is time to distribute it. There are a few options for where you can distribute your theme. One is to share it with the community using the forums on the http://communityserver.org web site. Another option is to publish the file on your personal site and then inform the community about it and link to its download page. Regardless of the technique you decide to use, you should always make sure to inform the Community Server community about your new creation.

New Theming Enhancements Before explaining some of the new controls that are available in Community Server 3.0, it is important to give credit and recognition to Ben Tiedt. Ben Tiedt is the person who is responsible for most if not all of Chameleon. The controls that existed in previous versions of Community Server are now located in the CommunityServer.Controls.Backport namespace. One of the reasons for including these controls is to help developers ease into using the new controls. Fortunately, with the straightforwardness and consistency of the new controls, it should be fairly painless for a developer to begin using them. Another important fact to consider when using the new controls is that they are no longer ID bound. This means that you are not restricted to using the IDs rcr or lcr to identify the right and left content regions. As a result, it should be more convenient for a developer to modify existing pages in Community Server. In addition, the new controls now support implicit data binding. This means that a control will be smart enough to know, based on the context of its use, what data should be presented to the user. The example that Ben Tiedt provides is that if a UserData control is rendered in a PostList parent control, then the UserData control will display the data that pertains to the author of each post. This is a tremendous step forward as it eases the task of a developer having to fetch and explicitly include certain data for each control.

100

Chapter 5: Changing the Look-and-Feel

Summar y Community Server offers an extremely powerful framework for creating and distributing custom themes. These themes can be tailored for individual applications as well as for an entire site. Furthermore, each theme is able to contain custom CSS, images, skin files, and master pages. The themes inside of Community Server allow developers and individual site members to customize the appearance of the parts of a site that they have access to. To help you understand how to customize a site in this way, you learned about the following main areas: ❑

Themes

❑

CSS

❑

Controls

❑

Master pages

❑

Skin files

❑

Creating a blog theme

❑

Recent theme enhancements

In the next chapter, you will learn about the Control Panel. The chapter will teach you how to administer the different applications that make up the Community Server platform.

101

Part III

Administering Community Server

Control Panel In this chapter, you will learn about the standard organization of the Control Panel. Furthermore, you will learn how to administer the various applications that compose the Community Server platform through the Control Panel. As a result, you will be more prepared to administer a Community Server site. Aside from general instruction on administering applications in Community Server, you will learn about some of the various settings that are available. The following topics are covered in this chapter: ❑

Administering blogs

❑

Administering photo galleries

❑

Administering file galleries

❑

Administering the Reader

❑

Changing global settings

Accessing the Control Panel To access much of the administrative functionality of Community Server, you will use the Control Panel. Under the default settings, all administrators and moderators are able to access the Control Panel once they have logged in to their account. In addition, the Control Panel link is displayed to users of roles tagged on the line in SiteUrls.config. It is very rare that you will need to change these roles; however, it is important to know how to do so in case a user has access to a feature on the Control Panel but is not in an administrative role. For example, even though blog owners are able to access the Control Panel, the link for it does not appear under the default settings

Part III: Administering Community Server Before I explain how you can display the Control Panel link to these individuals, follow these steps to access the Control Panel:

1.

Log in to your site using your System Administrator account by clicking the Sign in link in the welcome area section of the home page.

2.

Click the Control Panel link that now appears in your navigation bar.

If you have a user who should have access to some of the Control Panel features but can’t see the Control Panel, you have two options. First, you can assign the user to a role such as system administrator that will see the link. However, you may not want to assign that person to an administrative account when he or she is simply a blog owner and should not have any extra access rights. Thus, there is option two: create a new role and add it to the list of roles in the SiteUrls.config file for which the Control Panel link will be displayed. Here are the steps for implementing option two:

1. 2. 3. 4. 5. 6. 7.

Log in to the Control Panel. Click the Administration link in the Control Panel. Click and expand the Membership options on the left menu bar. Click Manage all Roles. Click the Add New Role button at the top of the grid. Type in the name AccessControlPanel and click Save. Open your SiteUrls.config file and add AccessControlPanel to the Control Panel link roles list.

Now, you have your site configured to display a link any time an account is in the AccessControlPanel role. You can now click the membership information for individual accounts and add this new role to their account. The next time that they log in to your site they should see a link to the Control Panel.

Understanding the Layout In this section, the logical organization of the Control Panel will be explored. You will quickly realize that it is relatively easy to locate a particular administrative page. Aside from exploring the layout, you will learn about the standard features that are a part of the navigation of the Control Panel. This section also demonstrates how easy it is to tie these features together in the dashboard.

Exploring Standard Options When you first arrive at the Control Panel, you are greeted with a convenient page called the dashboard. The dashboard provides you with links to Control Panel pages that you will use frequently. Notice in Figure 6-1 that these links are grouped according to the section of your site to which they most closely relate. Therefore, you will find a section for managing your blogs with links to common task items such as creating a new post, reviewing blog comments, managing a selected blog, and selecting a particular blog to manage.

106

Chapter 6: Control Panel For many of the administrative tasks that you will be performing you will more than likely be able to find the link to the appropriate management page on the dashboard. For security purposes, only the links for activities that the particular user has the permission to perform are displayed. Therefore, if a blog administrator logs into the Control Panel, he or she will not see a link for changing how all photo galleries are themed.

Figure 6-1: Default Dashboard in Control Panel

If you find that you are regularly performing a certain function, such as creating new blog tags, then you can easily add the link to the main dashboard page. This is a simple task for developers to perform because all they need to do is edit the root default.aspx page located in the ControlPanel directory. When you open this file, you will notice that its code is structured in a similar way to the resulting page’s source. Assume that you want to add your new link to the tags management page between the link for Review Comments and Manage Blog. In this case, you would add a link between the following entries in the /ControlPanel/default.aspx file:


  • Looking at the previous two links, you may notice that the text for the link is defined elsewhere (a file called ControlPanelResources.xml, to be exact). Therefore, when you add your link, you can either define it in the HyperLink explicitly or inside the ControlPanelResources.xml file. For the purposes of this example, the text will be defined explicitly. However, keep in mind that if you plan to localize your site you may want to move this text to a resource file. The important part of the entry is the link location, which is defined by NavigateUrl. Furthermore, you should also notice that there is an expression runat=”server” included in the HyperLink so that the link can evaluate “~” to the site’s root folder. The following entry can now be added between the lines shown previously to provide the new shortcut:

    107

    Part III: Administering Community Server
  • Blog Tags


  • Aside from managing your blogs, the dashboard also provides a system administrator with links to tasks related to managing membership, Photo Galleries, files, forums, the Reader, and general site settings. Therefore, before exploring the other links in the Control Panel, you should first become acquainted with the dashboard because it can allow you to quickly perform common administrative tasks. Another nicety of the dashboard screen is that it enables you to stay current with what is going on with Community Server. You will notice on the right side of the dashboard a box for displaying Community Server announcements. If you do not want to display these announcements, you can refer to Chapter 10 to learn about disabling this feature in the configuration files. However, if you are interested in staying current with Community Server happenings such as new product releases, then you should make a habit of reading these announcements when you log in to the dashboard.

    Understanding Organizational Structure The Community Server Control Panel is organized so that there is a logical division between system administrative tasks and other application-specific tasks. On the main Control Panel navigation bar, there are links for the management of a specific blog, forum, photo gallery, and file gallery. There is also a link to administration and reporting, which is for linking to the tasks that a system administrator would perform. Because of the separation of administrative tasks, it should be simple to find the action you need to perform. If you want to write a new blog post, for example, you can either click the New Post link from the dashboard or go to the blogs management section under My Blogs and select Write a Blog Post. Note that when you need to change a sitewide setting or a setting that affects multiple blogs or galleries, you should start in the Administration link. For example, if you want to set how all blogs should look by default, select the Administration section of the Control Panel and then expand the Blogs menu option. Here, you will find and can set the Default Presentation. In addition to providing access to change sitewide settings for a specific application, such as forums, you are also presented with the means to control membership, adjust general sitewide settings, view basic reports, and use system tools. All of these capabilities are geared toward enabling system administrators to perform their job more easily. Aside from the reports found in the Administration link, you will also notice several more in the reporting tab. To learn more about these reports, refer to Chapter 9. When you are trying to locate a setting in the Control Panel, you should first ask yourself if the setting is sitewide. If the setting is sitewide, then you should navigate to the Administration link. Otherwise, you should try to locate the setting under the main link that it relates the most to (My Photos, My Blogs). If you have navigated to the main administration page, you should now ask yourself if the setting relates to a specific feature, such as a blog or forum. If it does, then you should expand the menu for that particular link (Blogs, Photos, Files, Forums, Reader). Otherwise, navigate to one of the remaining

    108

    Chapter 6: Control Panel menus that relates most to the topic of your setting (Membership, Settings, Reports, System Tools). The organizational structure of the Control Panel makes it is convenient to locate a particular setting just by simply asking these questions.

    Administering Blogs The administration of blogs can be as complex or as simple as you want to make it. Blogs can be administered at many levels by many user roles, or you might only have one blog on a site administered by a single individual. Part of the beauty of Community Server blogs is how flexible they are. If an organization wants to have many bloggers without any limitations on how their blog looks or behaves, you can configure Community Server to do this. On the other hand, if an organization wants to place limitations on what blogs look like or who can place comments on them, Community Server can be configured to meet these demands as well. In addition to exploring how to accomplish both of the previous examples, this section will address everything from the basics, such as posting to a blog, to more advanced topics such as changing how a blog looks. In Chapter 3, the details for creating a blog and blog post were discussed. Therefore, the following will be used to simply provide a review and an expansion of the blogging section of Chapter 3.

    Creating a New Blog To create a new blog, you need to first be signed in as a blog administrator or system administrator. After you have logged in, navigate to the Control Panel and complete the following basic steps:

    1. 2. 3.

    Click Administration.

    4.

    Click Save and your new blog will be created.

    Expand the Blogs menu and select Create New Blog; the page that loads looks like Figure 6-2. Under the Settings tab, provide a name for your blog, which does not have to be unique. However, if you do provide the same name as another blog, you will need to specify a unique URL; otherwise, you will not need to even provide the URL.

    As you have witnessed, it is quite easy to create a new blog in Community Server. There are really only a couple of fields that need to be filled in order to get a blog running. Beyond the basic fields several more do exist for customizing a new blog. Fortunately, there is a question mark icon next to each of the fields that provides additional information to help you understand what each field represents. Therefore, the following information about the fields on the create blog screen will be more advanced. If you are interested in learning only the basic information about each field, consult the administration screen for creating a blog and hover over the question mark next to a field to learn more about it. The Enable Blog radio button option controls whether or not you want a blog to be enabled and visible to others. It is important to notice that if you disable a blog it can still be managed under the My Blogs main Control Panel tab.

    109

    Part III: Administering Community Server

    Figure 6-2: New Blog Screen

    Creating a New Post There are a couple of different ways that you can create a new post for your blog in Community Server. One way is to use the Control Panel and the built-in text editor. The second option is to use a third-party tool that is designed specifically for posting to blogs. If you do decide to use an external tool to create your blog, make sure that it supports the MetaBlog API. The following list contains a few popular tools that are available that work with Community Server, along with the web site where you can purchase or freely download the tool: ❑

    Qumana: www.qumana.com

    ❑

    Blogjet: www.blogjet.com

    ❑

    Microsoft Word 2007: www.microsoft.com/office

    ❑

    Windows Live Writer: windowslivewriter.spaces.live.com

    The previous list is obviously not comprehensive, but it is a good starting point for trying out various tools, both free and commercial, that will work well with Community Server. Now that you have a basic idea of what tools are available for writing posts for a Community Server blog, let’s now proceed to exploring how to create a post using the default post creation method. To create a blog post, you will need to be either an administrator or the owner of a blog.

    110

    1. 2. 3.

    Log in to your site and navigate to the Control Panel.

    4.

    Click the Write a Blog Post link under the Common Tasks menu on the left.

    Click the My Blogs link in the navigation bar. Select the blog that you want to post to; refer to Figure 6-3 for an example of what the Select Blog to Manage link looks like.

    Chapter 6: Control Panel 5.

    Fill out the Title and Body fields of the post, and click one of the following options: Save and Continue Writing Save, but don’t Publish Publish

    The three options are a new feature for Community Server and now allow you to save your work as it progresses. Therefore, if for any reason your browser window closes or your computer crashes before you are done with the post, you can easily return to where you left off. One of the differences between Save and Continue Writing and the Save, but don’t Publish buttons is that the second will switch a published post to being not published. Therefore, if you have a post that is currently published and you want to make it unpublished, you can click the Save, but don’t Publish button.

    Figure 6-3: Managing All Blog Posts

    Modifying an Existing Entry The Community Server Control Panel does a good job of separating the management of existing entries from the creation of new ones. To modify existing content, you simply need to navigate to the menu section entitled Manage Content. This section of the blog Control Panel allows you to manage posts, comments, pages, tags, lists, snippets, and the information about a particular blog. In the following example, however, you will be concentrating on changing the content of a particular blog post.

    1. 2. 3. 4. 5.

    Inside the Control Panel, click the My Blogs navigational link. Click Manage Content to expand the menu options. Click the All Posts menu option. Click the title of the post you want to modify (see Figure 6-3). Change any of the content of the selected post, and click one of the save options at the bottom. Note that if you do not want to modify whether the post is published or not, you can safely click the Save and Continue Writing button. The other buttons allow you to specify if you want this post to be published or not.

    111

    Part III: Administering Community Server

    Understanding Blog Groups The ability to assign a set of blogs to a particular group is a powerful feature. Often, you will want to group blogs that share a common characteristic so that you can keep them in manageable blocks. For example, if you have a large number of blogs that often talk about technology then you could easily place the blogs into a blog group called Technology. The simple act of grouping blogs into an organized structure can make the management of blogs less confusing. One of the benefits of grouping blogs is that you are able to present the blogs to site visitors in an organized way. Instead of simply presenting a long listing of different blog posts, you can present the blogs in related groups. A good example of a site utilizing blog groups to present an organized listing of blogs to the user is www.3cords.org. This is a site that I helped develop that groups blogs into one of three groups. As a result of this organized structure, the main page of the site presents each of these groups in a unique way. Currently, Community Server does now allow a blog to belong to multiple groups. Therefore, you are required to choose a single blog group to assign each blog to. However, you are able to change what blog group a blog is assigned to after you initially create the blog. To do this, you simply need to click the Administration link of the Control Panel and complete the following steps:

    1. 2. 3. 4.

    Expand the Blogs menu and select the Blogs menu option. Select the blog that you want to change the blog group for. Change the Blog Group drop-down option to the blog group that you want to assign the blog to. Click Save.

    Modifying Default Settings The default blog settings are located in the Default Settings menu option on the blogs menu, which is located in the Administration tab of the Control Panel. These settings control specific properties for all blogs. It is important to realize that a couple of these settings can be overridden at the blog level. For example, a blogger on your site can override what services are pinged whenever they create a new blog post. Here is a listing of the available settings on this page and a brief description of each:

    112

    ❑

    Create Directories will create a directory for each of the blogs on your site. If you have default .aspx enabled as a default document, then your site visitors can navigate to a blog simply by using the blog’s name, without having to provide the default.aspx page. In addition, you should make sure that the account your application is running as has write access to the blog’s directory. Otherwise, you will encounter a warning message when you create a new blog.

    ❑

    Auto Create, when enabled, will create a blog for new users. This is disabled by default, and you may want to keep it this way unless you are certain you want all new users to get a blog. Also, before you enable this setting, realize who has access to register on your site. If anyone is able to register and create an account, then you should realize that there is a potential for a rapid increase in the number of blogs on your site.

    Chapter 6: Control Panel ❑

    Enable Cross-Posting, when enabled, allows for a post to be published to different blogs. This option is disabled by default and can be controlled at both the individual blog level and further at the post level. The blog level can be found in the Default Post Settings menu option of the blog itself. Meanwhile, the post level option is found in the Advanced Options under the Advanced Options tab. You can set up blogs to cross-post to under the Spam, Ping and CrossPosting Settings menu option of the individual blog under the Global Settings menu section.

    ❑

    Enable Blog Owners to add content to HTML Head is disabled by default, meaning that bloggers are unable to add content to the section of their blog. If you enable this setting, then you can make it easy for bloggers to add tracking information to their blog, as well as any custom JavaScript or HTML tags that they deem useful. When this option is enabled, a new textbox is provided in the Control Panel for each blog under the Title, Description, and News menu option called Raw Header.

    ❑

    Default Group specifies what blog group you want to assign to new blogs if no other group is specified. This option can be changed when creating the actual blog; it merely selects the default group when creating a new blog. This is especially useful in conjunction with the Autocreate option because this is the group that will be used when blogs are created automatically.

    ❑

    Default Ping Services is a list of the ping services that you want to ping whenever a new post is created. Essentially, it is a list of services that are notified when new content is added to your blogs. This option can be overridden at the blog level; however, it can be useful to ping more than the default services if you want to help increase awareness about your site.

    ❑

    Default Aggregate Tags lists the tags that you want to use to filter content by for a site’s aggregate blog control. Therefore, if you only wanted to include those posts that relate to politics in Canada on your main page, then you would add Politics; Canada to the list of aggregate tags. By default, the list is blank, meaning that all posts that are marked for aggregation will be included on your site’s aggregation controls.

    ❑

    Service Post Count Limit is the maximum number of posts returned to requests made from the various Community Server services. If you want to change the number of posts returned to third-party tools using the MetaBlog API, for example, you can change this number from the default of 25.

    Managing Comments There is an inherent responsibility for bloggers to allow site visitors to post comments to their blog. Often, these comments are directed at the author or authors of the blog and almost always demand some level of response. As a result, bloggers must not only create new posts for their blog, but they should also manage and respond to comments made on their blog. It is important to realize that comments should be managed. By this, I mean that inappropriate comments should be deleted and inquisitive ones should be responded to. Fortunately, Community Server does an excellent job in assisting bloggers with managing their comments. One of the ways that it does this is through the use of spam filters that prevent spam from being displayed. Furthermore, additional custom spam filters can be developed to aid in the removal of spam from your site.

    113

    Part III: Administering Community Server From the Review Comments screen (see Figure 6-4), you are able to easily manage all of the comments on a particular blog. The Review Comments screen allows you to edit, unpublish or publish, and delete comments. To edit a comment, simply click the comment link found under the title column, change the comments text, and then save it. In addition, you are able to perform bulk commands, such as deleting or unpublishing several comments. The important thing is that you check this screen on a regular basis to manage your blog’s comments.

    Figure 6-4: Review Comments Screen

    Tweaking the Presentation There are a few different levels from which you can tweak the presentation of a blog. First, you can set a default presentation as a system administrator at the site level. This can be done either by editing the CommunityServer.config file or by changing the default presentation settings under the administration blog’s menu. If you want to force all blogs to have the default theme, then you simply need to uncheck the Enable Themes box in the Default Presentation administration screen for blogs and have the default theme selected. Similarly, you can configure your site to start all new blogs with a particular theme by selecting a default theme from the default presentation. However, users are able to change their particular default theme at the blog level whenever themes are enabled. In addition to selecting different themes, users are also able to override the stylesheet of a theme at the blog level. This allows for blogs to share the same theme but still look very different. You can modify these styles by selecting the CSS Overrides tab on the Change how my Blog Looks menu option of a particular blog when themes are enabled. For example, let’s assume that you have the default theme selected and want to change the background of the page to black. In addition, you want to remove the site header at the top of your blog as well as make all of the links blue until hovered over, when their background color will change. To do all of this, you only need to add the following to your CSS Overrides tab and click Save: body { background-color: #000; } a:link, a:visited, a:active { color: #0000FF; text-decoration: none; } a:hover { background-color: #EEE;

    114

    Chapter 6: Control Panel } .CommonTitleBar { display: none; }

    As you can see, it really does not require that many lines of code to drastically alter the way your blog looks. If you would like to change your blog’s presentation further using the CSS overrides, then you should first become familiar with Cascading Style Sheets (CSS). There are many books available and many free tutorials online that can help you become more familiar with using stylesheets. A couple of sites that I have found to be useful in learning more about CSS are www.cssbeauty.com and www.csszengarden.com. If you want to learn about what class styles are available on your blog, the best method may be to view the actual source code of your blog. You can do this easily in your web browser by navigating to your blog site and selecting the View Source option that is usually located on the browser’s View menu. Then, when you are sifting through the source, simply look for an ID or class on the tag that you want to manipulate. In addition, you can also override the stylesheet for an HTML element itself. A good example of this is the anchor and body elements that were changed in the previous example. Under the covers, all that happens when you add custom CSS overrides is that an extra stylesheet is included after the default stylesheets. This is true for the CSS overrides for both blogs and galleries. You can even control the name of the custom CSS file by editing the SiteUrls.config file’s blog_ customcss entry. The actual style that each user enters for their blog is added to the cs_Sections table as an extended attribute value for the respective blog.

    Global Settings There are additional settings that are available to configure all of the blogs on a site. These additional settings are found in the blog’s menu section of the administration page in the Control Panel. To access these settings, you will need to be logged in with an administrator account. One of the more interesting and unique settings is the Post Relevance Sorting. This feature can be used to control how your aggregate posts are sorted on the aggregate blog page (the page that a user sees when he or she clicks the blog’s link in the top navigation bar). By default, posts are sorted by date only. After you enable Post Relevance Sorting, you have a great deal of control over how posts are displayed on the aggregate page. There are standard values that are populated in the Post Relevance Sorting function to get you started. If you wanted to display the posts with the highest rating above all other posts, then you would simply set the Rating Factor as the highest to sort by. You can always tweak these settings until you arrive at the appropriate sorting method for your site. Note that the first option after enabling the sorting system is Number of Posts, which represents the size of the set of posts that will be scored to determine sort order. By default, the top 250 posts are scored and sorted, and older posts are ignored. Another setting that you can configure for all blogs is the Global Permissions setting. To edit this setting, simply navigate to the Global Permissions menu option of the Blogs menu on the administration screen. On the leftmost column of the permissions display are the names of all of the roles on your site. Once you locate the role that you want to change the permissions for, you simply need to place a check in the box in each of the columns for granting this role access to the respective blog ability. To help you locate the appropriate role, you can also click the columns on this page to sort the entries differently.

    115

    Part III: Administering Community Server

    Additional Options Community Server provides the functionality to easily manage list content. Lists may be used to link to your favorite blogs, resources, news sites, and so on. Lists are managed through the My Blogs link of the Control Panel, under the All Lists menu option on the Manage Content menu. You may create a single list or group list elements into many sections. For example, you could create a list called Search Engines, which would contain links to all of your favorite search engines. In addition, as mentioned previously, you could have a second list of your favorite bloggers. Along with the link title, each list element can have an associated short description, which will be displayed below the link. Furthermore, you can even specify how the link is related to you. If, for example, the link was to a friend’s blog, then you could state that the list item is a friend. Another nice option in the blog Control Panel is the ability to create snippets for use on your blog. A snippet is a keyword that the system will convert when you save your post. These are typically used to make linking to common resources easier. For example, through the use of a snippet, you can add the link to www.google.com as a snippet and then reference it by putting brackets around your text. In your post, you simply need to say [google], and a link will be created for you in place of [google]. If you find that you are creating links to the same pages often, then you may want to create an abbreviated way to reference them. For example, if you are referencing the Community Server Daily News often, you could abbreviate your snippet to CSDN and reference it as [CSDN]. Then, you only need to type Community Server Daily News in the text field of the snippet, which will replace [CSDN] with the link and text. You should also note that the name of the snippet is not case sensitive, so you can reference the Community Server Daily News as [csdn], [CsdN], [CSDn], and so on. Aside from replacing your text with links, you can also use snippets to replace part of your blog posts with other text. The link URL is not a required field when you create a snippet, which allows you to specify the text that will replace the snippet in your post. As a result, you are able to create your own language set for quickly creating posts. Perhaps the most useful type of text to replace will be acronyms. However, you can use snippets to create your own shorthand language for quickly inserting common phrases or words. In short, you can use snippets to replace anything you don’t want to type out in full any more.

    Administering Photo Galleries Photo galleries can be administered quite similarly to the management of blogs. They support a lot of the same types of options, such as changing the presentation or grouping of a gallery. They additionally support comments in much of the same way that comments are supported in blogs. Therefore, the following may sound familiar after reading about administering blogs. One of the benefits of this consistency is that the administration of blogs and galleries is easier to remember because they are both so similar.

    Creating a New Gallery The ability to create new photo galleries in Community Server is quite simple. After you have created a new photo gallery, you can immediately begin adding new photos to it and share those photos easily

    116

    Chapter 6: Control Panel with others. Here are the basic steps required to create a new photo gallery. Remember that you should first be signed in as an administrator to your site:

    1. 2. 3. 4. 5.

    Click the Administration link on the Control Panel navigation bar. Click the Photos menu to expand it. Click the Create New Gallery menu option (see Figure 6-5). Enter a name for your new gallery. Change any default settings that you see fit to, and click Save.

    Figure 6-5: Create New Gallery Screen

    Publishing New Photos By default, only gallery owners, gallery administrators, and site administrators can publish new photos. When you log in as one of these accounts, you will be able to see a link to the Publish New Photo under the My Photos Administration link. To publish new photos, complete the following instructions:

    1. 2.

    Click the My Photos link on the Control Panel navigation bar.

    3. 4. 5. 6.

    The Common Tasks menu section should be expanded; if it is not, then click it to expand it.

    7.

    Click Save to publish your photo. You can optionally change any of the default settings first so that you do not have to worry about modifying them later.

    If a gallery has not already been selected or if the gallery you want to publish the photo to is not selected, click the Select Photo Gallery to Manage button and select the appropriate gallery.

    Click the Publish New Photo menu option. Click the Upload Photo button to select the photo that you want to publish. The name of the photo will appear in the subject line; if you want to provide anything more descriptive, provide it now.

    117

    Part III: Administering Community Server When you click the Save button your photo will be published to your photo gallery at the time specified in the Options tab. If you would like to have your photo published at a particular time, you can change the time of your post under the Options tab. Also, if you do not want your photo to be published at all, save it in your gallery and, under the advanced Options tab, set it to Not Published. In addition, if your photo has metainformation for the other fields, such as a description, then it will be populated once you click Save. However, if you want to provide a more detailed description of your photo, it is helpful to add the additional details when you are publishing it.

    Reviewing Comments A detailed explanation of why you should manage comments was provided in the “Managing Comments” section earlier in this chapter. Therefore, I will not go into much detail here about why it is important to keep track of your photo comments. Instead, I will provide you will the information you will need in order to locate these comments and review them. The options for managing photo gallery comments are very similar to those of blogs. You are able to approve, unapprove, and delete comments, allowing you to control whether a comment is visible or not in a gallery. Remember, though, that comments must be enabled on your gallery before any will exist. If you would like to enable comments on your gallery first, make sure that they are enabled globally on the site; then complete the following steps to enable them at the gallery level.

    1. 2. 3. 4.

    Click My Photos on the Control Panel navigation bar. Click Settings to expand the menu options. Click the Default Post Settings menu option. Select the Yes radio button next to the Enable Comments text and click Save.

    To access the comments of a particular photo gallery, log in to your site as an administrator or gallery owner and navigate to the Control Panel. Once you are in the Control Panel, you simply need to complete the following instructions to access your photo gallery comments:

    1. 2. 3.

    Click My Photos on the Control Panel navigation bar. Click Manage Content to expand the menu options. Click the All Comments menu option.

    Managing Content The Managing Content screen is a useful way to quickly add new photos and manage existing ones. In addition, it provides a nice thumbnail preview for each of the photos to allow you to quickly locate a desired photo. It is important that you manage your photos so that you do not have a large number of photos that are no longer useful floating around your site. To access the Manage Content section of your photo gallery, simply navigate to your My Photos navigation link in the Control Panel and click the Manage Content menu section to expand the various options. One of the most useful features of the Manage Content screen is the Quick Add option for adding photos. This can prove to be extremely useful when a photo gallery owner needs to upload a large number of photos at once. If you are interested in uploading large quantities of photos easily, there are a couple

    118

    Chapter 6: Control Panel of solutions. You can use an open source tool called Chiwis that is available at https://sourceforge .net/projects/csgallerytool. The other option is to use the bulk import feature that is found in photo galleries’ Advanced Photo Settings Administration screen. To bulk import a selection of photos, simply upload the photo files, using an FTP tool, to your galleries folder and then use the advanced photo settings Import tab to import them. Thus, if your gallery were named Vacation, you would upload your photo files to Photos/vacation. All that is required to add a new photo to the selected gallery is to click the Browse button and select the image. The image will automatically be uploaded and added to the list of photos on the screen. If you want to provide more of a description of each photo, you can click the thumbnail and then type a description and tags on the resulting screen. In addition, you can also use the advanced options of a photo to make it unpublished.

    Managing Quotas Community Server provides an easy-to-use, yet very powerful quota management system for photo galleries. As an administrator, you are able to define a set quota for all users for both the amount of storage they can utilize and the number of photos that they can upload. In addition, you can optionally override these default settings on a per-role basis. To access the Quota Management screen, please follow these instructions:

    1. 2. 3. 4. 5.

    Log in to your site as an administrator. Click the Control Panel and then the Administration link. Click the Photos menu option to expand it. Select the Global Storage Quotas menu option. Either edit the settings per role by clicking Edit or select the Global Quotas tab to change the settings for the entire site.

    These quotas are extremely useful when you have a limited amount of storage on your site, or you may want to provide varying levels of accounts on your site. For example, if you were charging people a hosting fee to have a photo gallery, you might want to offer them a different amount of storage than what you would offer people for free. Therefore, you could offer people who have a professional account, and thus in the professional role, 50MB of storage, while free accounts may only receive 5MB. How you decide to use this powerful feature is up to you; just remember that it exists at the global level and at the role level for both the maximum amount of space a gallery can utilize and the maximum number of photos that a gallery can contain.

    Tweaking Gallery Presentation Changing the way that a gallery is presented to a site visitor is similar to changing the presentation of a blog. You are able to select a gallery theme as well as override the gallery’s CSS. If you would like an example of changing a site’s CSS, refer to the presentation section on blogs earlier in this chapter. It can be important for your general understanding, though, to realize that the resulting stylesheet when you override a gallery theme is called customcss.ashx. Therefore, when you look at the source code of a gallery page that you have overridden the CSS on, you will notice that this file is the last stylesheet listed.

    119

    Part III: Administering Community Server To change the theme of your gallery, you need to log in and access the My Photos section of the site, where you can expand the Settings and select Change how my gallery looks (see Figure 6-6). On the next screen, you can choose the theme you want to use from the Theme tab. In addition, you can specify custom CSS overrides for your gallery. The last tab is Layout Options, which you can use to specify how to arrange your photos when they are presented in tabular fashion. Furthermore, this tab also allows you to change how your photos are sorted when they are presented. The default layout is to have a table of four rows and four columns with the photos sorted by the date that they were created.

    Figure 6-6: Change how my gallery looks

    Administering File Galleries The Community Server offers many tools for administering file galleries. In this section, you learn how to create new folders as well as how to upload files to the file gallery. Another important area that you learn is how to manage and edit files that are currently uploaded to your site.

    Creating a New Folder You can think of a file folder in Community Server as being similar to a gallery or blog. The folder holds a specific grouping of files that can be managed separately from other folders. In addition, a folder can be organized into folder groups just as similar galleries or blogs can be organized into groups. To create a new folder, you must be an administrator and have access to the administration section of the Control Panel. Complete the following steps to create a new folder on your site:

    1. 2.

    120

    Click the Administration navigation link in the Control Panel. Click Files to expand the menu options.

    Chapter 6: Control Panel 3. 4.

    Select the New Folder menu option.

    5.

    If you would like to restrict or allow certain file extensions for your new folder, click the Options tab and type those extensions, separated by commas.

    6.

    Click the Save button to create your new folder.

    Provide a descriptive name for your new folder, and select the appropriate folder group to place it in.

    Adding Files Once you have a folder created, you can start adding files to it that do not have restricted extensions. To begin adding files to your folders, you must be an administrator or folder owner, or have been granted access to add files to the folders. When you are ready to proceed with one of these accounts and after you have selected a file that you would like to add to one of your folders, complete the following steps:

    1. 2. 3.

    Click the My Files navigation link on the Control Panel navigation bar.

    4. 5. 6.

    Provide a title and description for your new files; at this point you are able to click Save.

    7.

    Click Save to upload the file and add it to the selected folder.

    Select Upload File on the Common Tasks menu. Under the File tab, click the Pick File button, choose the file that you want to upload or link to, and click Save (see Figure 6-7).

    Provide any tags that you would like to use to help organize this file. If you do not want your file to be published, select the options tab and select the No option, which determines that this file is not to be published.

    Figure 6-7: Upload a File

    121

    Part III: Administering Community Server

    Editing Files Occasionally, a file in the gallery will need to be updated; perhaps it is a package and new items have recently been added. Another common example is when a .pdf or Word document is published to your file gallery and the content needs to be updated. Whatever the reason may be, it is important to understand that the file gallery allows a file to be updated. If you have a file that is currently in the file gallery and it needs to be updated, you can simply complete the following steps to accomplish this task:

    1. 2. 3. 4. 5. 6.

    Log in to the Control Panel and navigate to My Files.

    7.

    Change the title or description if appropriate, and click the Save button to complete the update.

    Click the Manage Content menu option to expand the menu. Click Files to see a list of the current files on the server in the selected folder. Select the appropriate folder where your file resides by clicking Select Folder to Manage. Click the title of the file that you want to update. The file’s title and description are presented, along with a link for updating the file. Click the Update File/URL link and upload the updated version of the file.

    Additional Settings The file gallery contains several additional settings for administering the gallery. These settings will allow you to manage tags, comments, and other more-advanced settings. Because the comment moderating and tagging concepts have already been explored, they will not be explained here. Instead, the advanced options, which mainly relate to Figure 6-8, will be explored.

    Figure 6-8: Advanced File Options

    122

    Chapter 6: Control Panel The first option on the Advanced Options screen, which is located under the Settings menu of the My Files page, allows an administrator to require that new files by nonadministrator and gallery owners be moderated. In other words, if a general site user who is not a member of an appropriate administrator role uploads a file, that file will not be published until an administrator or owner of the file gallery approves it. The other options are explained quite well by the Community Server help buttons next to each option. Therefore, the only other options that need to be discussed here are the Advanced Syndication Settings available in the menu directly below Advanced File Settings. The two options on this page allow an administrator or gallery owner to toggle whether or not site visitors will be able to subscribe to the gallery. Keeping these options enabled can be important to allow visitors to easily stay up to date when you add new files. An example of when this becomes extremely useful is when you are publishing software in the gallery that is supported with patches. Allowing your software users to stay up to date with new patches in this way will help enable them to always have current versions of your software installed.

    Administering Forums Moderating and administering forums is quite easy with Community Server. There are several options that allow an administrator or forum moderator to easily manage the content on a forum as well as manage more advanced settings. It is important to note that to accomplish many of the following tasks you should be logged in as a system administrator, forum administrator, or moderator. While these are not the only roles that are available for changing some of these settings, they will work for what is going to be discussed below. Also, it is important to note that these three roles all share the same permissions regarding forums. You should know that there is also an editor role that can be used to edit the content of forums.

    Creating a New Forum Aside from forum groups, there are also forums that can be parents of other forums. This is a vital feature because it allows discussions to branch out into subtopic areas. For example, a forum relating to software could have subforums for support and bug reporting. A forum is not required to have a parent, but it is still a good idea to identify if it is appropriate for the forum that is being created before proceeding with creating it.

    1. 2. 3.

    Click the Administration tab.

    4.

    Type in the name of the forum and select any of the other options that are appropriate, such as selecting the forum group.

    5.

    Click the Save button, and a forum is created.

    Click the Forums menu and expand the options. Click the Create New Forum menu option. If you do not see this option, then you should select Manage All Forums and click the Change to Grid View button in the lower-right corner of the resulting page. After you have enabled the Grid View, you should see an option for Create New Forum.

    123

    Part III: Administering Community Server

    Creating Posts The interesting thing about the creation of forum posts is that they occur outside of the Control Panel. It is still important to know how they are created and how an administrator or moderator can manage who has access to create them. The management of posts in a forum can be thought of as being similar to the management of comments for a particular blog, in that both allow for posting to be disabled for anonymous users at a global and application level. By default, anonymous users are not allowed to make posts to any of the forums until an administrator enables this at the global level under the Global Forum Settings menu option. In addition, new posts can be set for moderation, meaning that they require approval before being published. Under the covers, whenever a forum has Moderate Posts enabled and the user is not moderated, new posts are simply marked as not approved in the database. However, these new posts are only marked as not approved when they are not coming from an administrator or moderator. In most situations, these would be posts from registered users or anonymous users. Whenever a moderator or administrator reviews the post and decides to approve it, the post is marked as approved in the database. Whenever going through the following steps for creating a new post, it’s important to notice that all new posts come from the AddPost.aspx page of the /forums directory. This page handles the creation of new posts, responses to existing posts, reporting post abuse, and creation of other types of new posts. It determines what type of post is being created from the querystring; therefore, if you try to navigate directly to the page with nothing on the querystring, you will encounter an error.

    1. 2. 3. 4.

    Click the Forums tab on the main navigation menu of your site. Click a forum title to select it. Click the Write a New Post button. Type your new post for this particular forum and click Post.

    Managing Ranks The ability to rank users based on the number of posts that they contribute to forums is something that can greatly encourage more participation among users. With the Community Server ranking system, users can now automatically be recognized for their hard work and participation in all of the forums. To understand ranking a little better, consider the following example. You are administering a role-playing community, and you want to encourage forum participation among your role players. You decide that you will use the ranking system and provide your members with fun titles depending on how many posts they contribute. You set up the ranking so that users who have posted fewer than 100 posts are titled Peon, while users with 100–500 posts are lvl 5 Barbarians, participants with 500–1000 posts are lvl 10 Warriors, and those with greater than 1000 posts are called lvl 20 Dungeon Masters. In this way, users are now recognized and feel a level of competition that leads them to participate more in the community. To manage ranks, you should log in as an administrator with access to the forum Control Panel. Log in and click the Administration link on the Control Panel, and complete the following instructions to establish a new rank:

    124

    Chapter 6: Control Panel 1. 2. 3. 4.

    Click the Forums menu to expand the menu options.

    5.

    Click the Save button, and the new rank is added to the list of ranks.

    Click Manage Ranks. Click Add a New Rank. A new modal box will appear where you can enter the name of the new rank, the minimum number of posts to be considered part of this rank, the maximum number of posts, and an optional rank icon that will be displayed with the rank.

    Global Settings Changing the global settings for forums allows an administrator to help manage what posts are considered popular, prevent duplicate posts and flooding, change the settings for file attachments to posts, change how posts can be edited after being published, and handle other general settings. To see what this page looks like in your site, you can refer to Figure 6-9. There is a lot of power located in this administrative page; therefore, it is important that you understand it fully.

    Figure 6-9: Global Forum Settings

    The Popular Posts tab allows an administrator to configure the requirements for a post to be considered popular. Whenever a post becomes popular, the icon next to it will gain a star so that it stands out more than other posts. The amount of site traffic and post feedback should determine the requirements for a post to become popular. For example, if most posts only have a couple of replies, then perhaps it would be appropriate to lower the Popular Post Replies number to five or something more suitable for your site. If your posts generally only have around 20 views, then the Popular Post Views number should also be lowered. On the other hand, you do not want to create a situation in which all posts are marked as

    125

    Part III: Administering Community Server popular; therefore, you may need to increase these numbers if your site draws large amounts of traffic or post replies. Again, this is a way to distinguish those posts that draw the most attention from others. In some ways, it can help encourage contributors to make their posts meaningful so that they will eventually become popular. The Duplicates & Flooding tab allows an administrator to control how often a user is allowed to post and if they are allowed to duplicate their posts. By default, both of these options are disabled, meaning that users can post as often as they want and duplicate their posts. In many situations, this is fine to leave as is. However, if you start to notice that users are flooding your forums, then you should consider enabling this option and setting the time to a value that you feel is appropriate. The Attachments tab is important because it controls whether or not forums posts are allowed to have file attachments, and almost more importantly what types of files are allowed to be attached. In addition, there is a maximum file size that you can specify to control the size of files that can be attached. The type of forums that are being run should determine these various settings. The default configuration is to enable file attachments that are less than 64KB and to disable images from being displayed inline. However, it may be appropriate to enable image attachments to be displayed inline so that they can be embedded in posts. Another important setting is controlling the types of file extensions that are allowed to be attached. If your community shares a lot of .pdf or .doc files, then they need to be added to the valid extensions. To accomplish this, simply append the following to the list of extensions: ;pdf;doc. The Editing tab allows you to control whether or not posts can be edited after they are published and what is associated with this editing process. By default, a person can edit a forum post that they made at any time and do not have to explain why they are editing it. However, you can use the Age Limit value to specify the maximum length of time after a post has been published that it can be edited. In addition, edit notes can be required so that whenever users are changing the content of a post they have to explain why it was changed. This can be thought of as being similar to a check-in message that is entered whenever someone is changing a file on a source control system. Being able to edit a post after it has been published can be a lifesaver for many users, especially given how easy it is to make a mistake the first time around. On the General tab, there are several remaining settings that should also be considered when administering forums. The first option enables a link to be added for RSS syndication for subscribing to the content on public forums. Another option that is important for organizational purposes is the ability to tag individual posts. By default this is enabled, which means that posts can all be organized into the subject that they relate to. In addition to the other settings, the ability to change how many posts are on a single page can be very valuable.

    Administering the Reader The Reader is a slightly different feature to administer because aspects of it are located outside the Control Panel. Whenever you are logging in to your site as an administrator, you should notice that a new link is added to the menu called My Reader. This is where the feeds can be added to the reader; meanwhile, there is also a piece that sits in the Administration menu for controlling which of these feeds are visible in the reader. The reader is really more of a personal feature for staying current with whatever it is that you are interested in.

    126

    Chapter 6: Control Panel

    Managing Feeds To manage feeds, you should navigate to your personal Reader by logging in to the site and selecting My Reader from the top navigation bar. Once you are in the Reader, add several feeds. Community Server does a good job of making this an easy task to complete because there is a simple-to-use context menu on the My Reader page. Therefore, simply right-click the My Feeds entry on the left window pane and choose New Feed. In addition to the New Feed button, there are also New Folder, Import OPML, and export OPML buttons. The New Folder option allows you to create a new folder for grouping similar feeds. For example, a folder could be created for Community Server that would contain feeds from http://communityserver.org, Rob Howard’s blog (weblogs.asp.net/rhoward), and Scott Watermasysk’s blog (www.scottwater.com). These various subscriptions will help enable you to stay current with what is happening in the Community Server world. The option to import or export feeds using the Outline Processor Markup Language (OPML) standard is important because it means that your feeds are easily transferable between different readers. Perhaps you are already using a feed reader and want to now switch to the Community Server Reader. With these options you can easily import your existing feeds using the OPML format. In addition, if you want to switch away from Community Server, or simply want to share your feeds with a friend or coworker, you can export them, again using OPML. This is an important feature and should not go ignored when using the Reader. To control these feeds further, an administrator can go to the Reader menu under the Administration tab and click the Manage Feeds menu option. On this page, a listing of the subscribed feeds is provided, along with a convenient button to edit the feed. Whenever you do edit the feed, you can update the URL that the feed comes from. This is important for a situation where a blog has moved and the URL needs to be updated.

    Additional Settings Aside from the standard management of feeds link, there are also a few other links that are a part of the Administration menu for the Reader. An important one is the Manage Access setting, which allows a system administrator to specify what roles are able to control the Reader. In addition, the Settings menu option also has a few important options. The Last Modified Interval setting is especially important because it allows you to determine how often the content from feeds is updated.

    Managing Settings The last section that will be explored in this chapter is the management of sitewide settings located under the Settings menu of the Administration link in the Control Panel. Under this menu are links to several pages that allow you more advanced control over the content and behavior of an entire site. These settings can override application-level settings, such as who is allowed to create posts and even the sizes of syndicated content. Therefore, it is important to understand that whenever you are editing these settings, they are sitewide and should be changed with caution. Fortunately, these settings are often only changed when originally configuring and setting up a site; therefore, they should not need

    127

    Part III: Administering Community Server to be changed often. It is also important to realize that changes to some of these settings may not be reflected immediately because they are often cached for performance reasons. Therefore, if you make a change and do not see it reflected immediately, you may want to wait a few minutes.

    General Site Settings Review Figure 6-10 to see a listing of the settings that are available on this page. They mainly change how information will be displayed on your site. The first option, for enabling Ink, is useful if your site contributors are using computers with a screenwriter enabled, such as a tablet. The second option, for enabling the site description to be displayed, is useful if the site header has not been changed drastically. If this is enabled, the description that is provided in the Site Description field of a separate administration page to be displayed on the home page. The other settings are well described in the help icons, so it is easy to learn more about each option.

    Figure 6-10: Global Site Settings

    Site Name & Description The Site Name & Description page allows for the identification of a site and also control over the head tag of each page on your site. If, for example, you want your site to be identified specifically by certain keywords by search engines, then you can include a list of those keywords in the Search Meta Keywords list. Likewise, the Search Meta Description can also be used to provide a basic description of your site to make it easier for search engine spiders to identify your site. These will be added to the headers of each the pages so that they are more identifiable by search engines. An important option is the Raw Header, which allows an administrator to insert standard JavaScript or anything else into the head tag of