Community Starter Kit-function Introduction

Source: Internet
Author: User
Create a community

 

After downloading and installing Community Starter Kit, the first thing you want to do is to delete the sample site data. You can click the "login" link at the bottom of the navigation bar and log on with the admin password as the admin user. (Because this password may cause security risks, please change it as soon as possible .) After successful logon, the new link (Admin) will appear on the navigation bar. Click the link to go to the management section of the site. scroll down to find "delete ".
Content.

When the content is deleted and returned to the community homepage, you will notice that some sample content is retained. To replace the homepage content with your own content, return to the Management page and click "edit"
Sections, click the home area, and provide a site title, description, and logo. You can also use this "Edit sections" option to change the basic layout of the home page, select a topic, or enable many optional features of the home page (such as displaying web boxes or web service boxes ).

After setting the homepage layout, you can add multiple regions to the site. A site can have unlimited regions.Figure 3Lists various types of zones (or modules) that can be created ).

To add a region, click the "Edit sections" link on the Management page. You can create multiple regions of the same type. For example, the community site shown in Figure 2 contains two Article regions: News and articles. You can use the parent region to help organize a group of similar areas. For example, if you want to separate the downloaded content by general categories, you can create a parent region that contains several download regions (such as user contributions, controls, and speaker presentations.

On the Edit sessions page, you can enable various optional features for a specific region, such as arbitration or email notification. You can also choose to publish the content of this region as a Community web service.

Topic

 

Community Starter Kit is based on ASP. NET
The forums application is designed like the forums application. It also uses themes (also known as appearances) to separate the user interface from the code. A topic is far more than a style table. In fact, there will be no content without a topic, because the topic contains all the content displayed on the site
Control. SubjectFigure 4.

To create a topic, add a folder under the communities \ common \ themes folder. The topic name is derived from the name of the folder. Under this folder, createFigure 4. Fortunately, because all themes are inherited from the basic theme default, you do not have to fill in all folders of the theme. Therefore, if you do not provide the appearance required by the topic, Community Starter Kit uses the default topic appearance.

If the default topic contains more than 75 files, you can create a basic topic by providing only a few files. I created a basic topic named small, which is a simplified version of the default topic. The basic difference between it and the default theme is that it uses a smaller font, the color is changed from blue to red, and the tabs adopt different la S. My new topic consists of the following six files:

Communities \ common \ themes \ small \ images \
Redshiny3dsquarebullet_7x7.jpg

Communities \ common \ themes \ small \ skins \ controlskins \
Sections_sectionmenu.ascx

Communities \ common \ themes \ small \ skins \ pageskins \ default. ascx

Communities \ common \ themes \ small \ styles \ an_red_arrow.gif

Communities \ common \ themes \ small \ styles \ default.css

Communities \ common \ themes \ small \ styles \ redyellowstar.gif

Of course, the more elements provided, the more complete the topic. For example, if you go deep into a region using the small topic, you will still see the control with a blue background. However, if I have not changed the color scheme of the topic, this is the best practice. To create a new topic, you can use the existing topic as the model and modify its appearance and style.

Create a new module

 

Although this is a bit more complex than creating a topic, you can also create a new module for the community. For example, I created a module named jobs to track work announcements.

To create a new module, first Add a new table to the communitystarterkit database to track new module items, and name the table community _Module(Where,ModuleIs the name of the new module ). The primary key of the table should be namedModule_ Contentpageid, together with the names of other fields to be collected for this module.

You will need to use the stored procedure to add new module items, edit existing projects, retrieve the project list, and then retrieve all fields of a single project. Name the stored procedures of the jobs module community_jobsaddjob, community_jobseditjob, community_jobsgetjobs, and community_jobsgetjob. I copied the stored procedures of the articles module, used them as models of the jobs stored procedures, and added other fields necessary for tracking work announcements. Community_jobsgetjobs is used to retrieve the job list on the jobs_section page. This module calls the community_getpagedsortedcontent function to page the output content (seeFigure 5).

Create a new folder under engine \ modules that will contain the code of this module. In this folder, there should be three subfolders named components, content, and controls. For the jobs module, I created engine \ modules \ jobs \ components, engine \ modules \ jobs \ content
And engine \ modules \ jobs \ controls folders. The components folder should contain two class libraries. The first class library contains classes derived from the contentinfo class, and the second class library contains Utility Classes that call the stored procedure of each module.

Use community of Visual Basic. net
Starter Kit, I created a class library named jobinfo. VB, which contains a single class (jobinfo ). I use the articleinfo. VB class library as the model of my class library. The jobinfo constructor uses the single parameter datareader to extract each field from the jobs table and put them into a private variable that will then be exposed as a series of attributes of the jobinfo class (seeFigure 6).

The jobutility class provides interfaces between the jobs module and the jobs stored procedure, including a single class of jobutility, which has four methods: addjob, editjob, getjobs
And getjobinfo. The getjobs method calls the community_jobsgetjobs stored procedure and returns the arraylist of the jobinfo object (seeFigure 7).

For each basic page supported by this module, the content folder should contain a class library. These classes will be the code of the user control created in the future. At least, your module needs to provide classes for each of the following types of pages: Add a project, edit a project, and display a project list.
(For the region page) and display a single project (for the project deepening page ). These classes must be derived from contentaddpage, contenteditpage, contentlistpage, or contentitempage. As you may have noticed, content often has a one-to-one relationship with the stored procedures they call.

I have created four class libraries (addjob. VB, editjob. VB, jobsection. VB, and job. VB). Each class library uses the articles content class library as the model. The content class is used to adhere to the jobinfo class and user control appearance. The job class in the job. VB class library displays the complete information of a specific work list (seeFigure 8).

For each work item displayed on the job and jobsection pages, the controls folder contains custom server controls. I created the following server controls for the job page: jobcompany, jobtempstatus, region, jobstartdate, joblocation, jobeducation, region, jobsalary, jobcontactname, jobcontactphone, region, jobcontactweb, and jobeditcontent. For the jobsection page, I created the itemjoblocation control. The jobcompany custom control is displayed inFigure 9.

Now, you need to create some user controls to show the appearance of each basic module page corresponding to the skinnedcommunitycontrol class created in the previous step. At least, you must provide a set of content appearance user controls for the default topic. You can also provide content appearance user controls for other themes.

I created three user controls in the themes \ Default \ skins \ contentskins Folder: jobs_addjob.ascx, jobs_jobsection.ascx, and jobs_job.ascx. There is no user control for editing work, because
The jobs_addjob.ascx control executes dual tasks. It supports both adding and editing work.Figure 10
The Excerpt from the jobs_job.ascx user control is displayed. Note that
Reference of the custom Server Control named jobcompany and jobtempstatus in the engine \ modules \ jobs \ controls folder.

Now, I have added a style to the new content control's default style table (themes \ theme \ styles \ default.css.Figure 11
Displays several new styles.

Finally, I added entries for this project and project region pages to the community_pagetypes and community_namedpages tables in the database. By imitating existing
The stored procedure named community _ maintenanceinitializearticles created by the community_maintenanceinitializejobs stored procedure is relatively simple. Running this stored procedure creates necessary table entries.

Figure 12 jobsection page

 

Figure 12 shows the jobsection page of the Ballard. Net community site. If you click the "Read More" Link under the Work announcement, the job page shown in 13 is displayed.

Figure 13 job page

 

Download a copy of the files that constitute the jobs module (and the small topic) from the link at the beginning of this article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.