Drupal 7 Social Networking
上QQ阅读APP看书,第一时间看更新

Starting to build our site

Now that we have a basic plan of our site's static content, we can start to build the static elements of our site.

Using taxonomy

Let's start with taxonomy. Since this is a way of categorizing content, it makes sense to set this up before we start creating content.

Creating the vocabulary

We need to go to Structure | Taxonomy | Add vocabulary to define a group of terms to categorize our content with. Enter a name of Dinosaur Breed and a description of specific breed of dinosaur, before clicking the Save button. We will use this to categorize content which relates to specific breeds of dinosaur:

With the vocabulary created, we now need to add terms to it, using the add terms link:

Here we can add the various breeds of dinosaur to the vocabulary using the create term form:

Now that we have a new vocabulary with terms associated with it, we need to link it to the appropriate content types. We need to go to Structure | Content types | Basic page | Manage fields.

From here, we enter Dinosaur Breed as the field label, dinosaur_breed as the field name, Term reference as the field type, and Select list as the Widget:

Next, we select Dinosaur Breed as the vocabulary to use:

Finally, we ensure the field is set as required, and that the maximum number of values is set to 1:

Now, if we go to create a page, we can select the breed of dinosaur it relates to:

Now we have a new page created, related to T-Rex:

If we click the taxonomy term, we are taken to a page listing content which has been categorized as T-Rex related:

Tip

Try it yourself

Now that you have an understanding of how to create content, why not create all of the static content we planned earlier. Make sure you select a menu for the pages to appear in. Once you have done that, why not create a Frequently Asked Questions page; use taxonomy to tag pages as FAQ answers and use the Drupal link to all content tagged with FAQ answers as the link to the FAQs pages in the menu.