|
||
The forums page will host the site's discussion forums. All the forum content will be displayed by this single page using the Forum group web part. In order for the page to display some content, there has to be some forum group defined via the administration interface.
Before you start creating the page, it is therefore recommended to create one forum group. In this chapter, you can see how a sample forum group can be created.
If you needed some more information about the Kentico CMS Forums module, you can find it in Kentico CMS Developer's Guide -> Module Forums.
1. Go to CMS Desk, select the root of the content tree and click New. Choose the Page (menu item) document type.
2. In the following dialog, choose the Create a blank page option. Enter Forums into the Page name field and click Save.
3. Switch to the Properties -> Template tab and click the Edit template properties link.
4. In the pop-up window, switch to the Layout tab and replace the original layout code with the following code:
<!-- Container --> <div class="forumSearch"> <cc1:CMSWebPartZone ID="zoneLeft" runat="server" /> </div> |
Click Save.
5. Switch to the Design tab. You can see only one web part zone on the page, so let's start adding web parts to it. First, we need a heading. Click the Add web part () icon of the zoneLeft web part zone and choose the Text -> Editable text web part. Set the following properties of the web part, leave the rest of them as they are:
•Web part control ID: editabletextHeader
•Editable region title: Header
•Editable region type: Text box
•Content before: <h1 class="header">
•Content after: </h1>
Click OK.
6. Switch to the Page tab and enter Forums into the Editable text web part's text box. Click Save.
7. Switch back to the Design tab. Because some forums might be accessible only to authenticated users, we will add the Logon miniform web part below the heading. It will be displayed only to unauthenticated anonymous site visitors. Click the Add web part () icon of the zoneLeft web part zone and choose the Membership -> Logon miniform web part. Set the following properties of the web part, leave the rest of them as they are:
•Display to roles: _notauthenticated_
•Logon failure text: Error logging in.
•Username text: username
•Content before: <div class="ForumLogonBox">
•Content after: </div>
Click OK.
8. Below the logon mini form, the Forum search box web part will reside. It will enable users to search in the forum contents. Click the Add web part () icon of the zoneLeft web part zone and choose the Forums -> Forum search box web part. Set the following properties of the web part, leave the rest of them as they are:
•Advanced search path: /Forums/Forum-search
•Context search: enabled
•Content before:
<div class="ForumSearchBox"> <table cellspacing="0" cellpadding="0"> <tr><td style="vertical-align:top;padding-top:3px;"><b>Search forums: </b></td> <td style="text-align: right"> |
•Content after:
</td></tr></table></div><div class="clear"></div> |
Click OK.
9. Below the Forum search box, we will place the Forum group web part. In order for it to display any content, you should have created some sample forum group as mentioned in the beginning of this chapter. Click the Add web part () icon of the zoneLeft web part zone and choose the Forums -> Forum group web part. Set the following properties of the web part, leave the rest of them at the default values:
•Group name: choose your previously created forum group
•Enable favorites: enabled
•Thread view mode: Flat - oldest to newest
•Allow private messaging: enabled
•Allow friendship request: enabled
•Access denied page URL: ~/Special-pages/Access-denied.aspx
•Use friendly URLs: enabled
•Friendly Base URL: ~/Forums
•Content after: <div style="height: 15px;"></div>
Click OK.
10. Below the Forum group, we will place the Forum search results. The web part will be displaying results of forum search performed by the Forum search box web part above. Click the Add web part () icon of the zoneLeft web part zone and choose the Forums -> Forum search results web part. You can leave all properties of the web part at the default values.
11. The last web part on the page is the On-line users web part. We will set it up so that it displays the number of users who are currently browsing the forums section. Click the Add web part () icon of the zoneLeft web part zone and choose the Membership -> On-line users web part. Set the following properties of the web part:
•Transformation name: Community.Transformations.MembersOn-line
•Path: /Forums
•Use default cache dependencies: enabled
•Content before: <br />
Click OK.
12. The page is now finished. In Design tab, it should look as in the following screenshot.
13. Finally, we will save the page as a new page template so that it can be reused in the future (we will use it when creating the Forum search page). Switch to the Properties -> Template tab and click the Save as new template link. In the pop-up dialog, enter the following details:
•Template display name: My Community Site - Forums
•Template code name: MyCommunitySite.Forums
•Template category: My Community Site templates
•Template description: some text describing the page template
Click OK. Click Save.