Creating the Student Blog in Drupal using Cloning

Exclusive offer: get 50% off this eBook here
Drupal for Education and E-Learning

Drupal for Education and E-Learning — Save 50%

Teaching and learning in the classroom using the Drupal CMS

€20.99    €10.50
by Bill Fitzgerald | December 2008 | Drupal Open Source

Blogging in Drupal encompasses a range of learning activities. When incorporated into a course as a regular part of the coursework, blogs provide an incredibly powerful means of tracking student growth. For students who are disorganized (that is, students whose backpacks resemble tumbleweed), the blog can also be an organizational tool. Most importantly, though, blogs create a record of student work that can be accessed at any time. As such, blogs provide a convenient window into both process (how students work) and product (the end results of student work). In this article by Bill Fitzgerald, we will see how to create a student blog.

For the purpose of this article we will clone the already existing Teacher Blog and create the Student Blog.

Setting Up the Student Blog

To create the student blog, we need to do two things:

  1. Give users in the student role permissions over the blog post content type.
  2. Clone the teacher_blog view, and edit it to display student blog posts.

Assigning Permissions

To allow students to blog in the site, we need to allow users in the student role the ability to create blog posts. Click the Administer | User management | Roles link, or navigate to admin/user/roles. Click the link to edit permissions for the student role.

Navigate down to the section for the node module. Select the options for create blog_post content, delete own blog_post content, and edit own blog_post content.

Click the Save permissions button to save the settings.

Students can now blog in the site.

Clone the Teacher Blog

Now that students have the ability to create blog posts, we now need to create a central place where people can read these posts. We have already set up this structure for the teacher blog; cloning this pre-existing view will allow us to quickly replicate this structure for the student blog.

To begin, click the Administer | Site building | Views link, or navigate to admin/build/views. Scroll down to the teacher_blog view and click the Clone link.

Creating the Student Blog in Drupal using Cloning

Change the view name to student_blog; change the view description to All posts to be displayed in the Student blog; change the View tag to student. Click the Next button to continue.

In the default settings, we want to change the User: Roles filter. As shown in the following screenshot, you can verify that you are editing the Defaults as indicated by Item 1; to edit the User: Roles filter, click the link as indicated by Item 2; and to edit the Title, click the link indicated by Item 3.

Creating the Student Blog in Drupal using Cloning

Change the User: Roles setting to student; this will only select content posted by users in the student role. Change the Title setting to Student blog.

As we add more content types (audio, video, and images) we will need to revisit this view to update the Node:Type filter. At this stage, this filter only selects blog posts and bookmarks.

Then, as shown in the following screenshot, click the Page link (indicated by Item 1) to change the settings for the Page display for this view. We need to edit both of the options under Page settings (indicated by Item 2). We also need to edit the Header (indicated by Item 3) in the Basic settings.

Creating the Student Blog in Drupal using Cloning

Under Page settings, change the Path to student-blog, and change Menu to Normal: Student blog.

Under Basic settings, edit the Header to read Hello! You are viewing posts from the student blog. Enjoy your reading, and comment frequently.

Click the Save button to save the view.

All student blog posts are now visible at http://yoursite.org/student-blog.

Getting Interactive

Now that students can create blogs in the site, you have the ability to foster dialogue within your class. The easiest way, of course, is simply through commenting. Students have the rights to comment on assignments, and on teacher and student blog posts. However, students might also want to reference other pieces of content in their work. In this section, we will set up a mechanism that will keep track of when one post within the site references another post within the site. This way, people can see when exchanges are occurring about different posts, and it provides another way (in addition to comment threads) for people to hold discussions within the course.

Seeing Who's Discussing What

Within the site, we will want to see who is discussing what posts. In web parlance, this is referred to as a backlink. Fortunately, the Views module comes with a means of tracking backlinks by default. We will clone and customize this existing view to get exactly the functionality we want.

The process of cloning this view includes the following steps:

  • The default backlinks view needs to be enabled and cloned.
  • In the cloned view, the different displays need to be edited:
    • In the Default display, Fields need to be added to the view, the Arguments need to be adjusted, and the Empty text needs to be deleted.
    • As the new view will only generate a block, the Page display should be removed.
    • In the Block display, the Items per page needs to be increased, the More link needs to be removed, and the Block settings needs to be changed.
  • Then, once the new view has been saved, the block created by this view needs to be enabled.

Enabling and Cloning the Backlinks View

To get started, click the Administer | Site building | Views link, or navigate to admin/build/views. As shown in the following screenshot, enable the default backlinks view.

Creating the Student Blog in Drupal using Cloning

Once we have enabled the backlinks view, we want to clone it. So, we click the Clone link.

Change the View name to conversations, and change the View description to Cloned from default "backlinks" view; displays a list of nodes that link to the node, using the search backlinks table. The View tag can be left blank.

Click the Next button, which brings us to the Edit page for the view.

Editing the Default Display

As shown in the following screenshot, we will make four main edits to this view. We will add Fields, adjust the Arguments, delete the Empty text, and remove the Page display.

Creating the Student Blog in Drupal using Cloning

To add Fields, click the + icon as indicated, in the preceding screenshot, by Item 1. Add three fields: Node: Post Date; Node: Type; and User: Name. Click the Add button, and then configure the new fields to your preferences.

Next, edit the Arguments by clicking the Search: Links to link as indicated in the preceding screenshot by Item 2. We will edit the argument handling as shown in the following screenshot:

Creating the Student Blog in Drupal using Cloning

Select the options to only validate for Blog posts and Bookmarks. Additionally, check the option for Validate user has access to the node.

These argument settings confirm that we are only checking for backlinks on Blog posts and Bookmarks. As we add more content types (for audio, video, and images) we will need to update this view to check for backlinks on these additional content types as well.

Click the Update button to store these changes.

Then, we will remove the Empty text by clicking the Filtered HTML link as indicated by Item 3 in the screenshot just above the preceding one. Delete the existing empty text string, and click the Update button to store the changes.

Deleting the empty text makes it so the view will not be displayed if the view returns no content. Although this would not be useful on a Page display, it is useful for a Block display, as this hides the block when there is nothing to show.

Drupal for Education and E-Learning Teaching and learning in the classroom using the Drupal CMS
Published: November 2008
eBook Price: €20.99
Book Price: €34.99
See more
Select your format and quantity:

Remove the Page Display

As shown by Item 4 in the screenshot just above the preceding one, click the link to show the Page display type.

Creating the Student Blog in Drupal using Cloning

We are going to be displaying the backlinks in a block, and will not need the Page display. Therefore, we want to remove it by clicking the Remove display button as shown in the preceding screenshot.

Once we have clicked the Remove display button, click the Block link to edit the Block display.

Edit the Block Display

When we are editing the Block display, we will need to edit three values.

Creating the Student Blog in Drupal using Cloning

Change the Items per page option (as indicated by Item 1 in the preceding screenshot) to 10.

Change the More link option (indicated by Item 2) to No by unchecking the Create more link checkbox.

Change the Admin text under the Block settings option (indicated by Item 3) to conversations.

Click the Save button to save the view.

Then, return to Administer | Site building | Views link, or navigate to admin/build/views, and disable the default backlinks view. Although we used it as a starting point, we now have no further need for it; therefore, we can disable it.

Enabling the Block

As a result of the modifications we have just completed for our new view, we created a block that will display any backlinks when we are looking at Blog posts or Bookmarks. For the final step, we will enable our new block.

Click the Administer | Site building | Blocks link, or navigate to admin/build/block.

We named this block when we adjusted the Block settings as shown in the preceding screenshot by Item 3. The value of the Admin text, which we set to conversations, is the name of the block.

To display the block, use the drop-down menu to select the desired region.

Creating the Student Blog in Drupal using Cloning

Select Right sidebar, and then click the Save blocks button at the bottom of the page to save the settings.

Seeing It Work

In this article, we have built the framework for the student blog, and started to build out the functionality that will support various types of interaction and discussion between people on the site. Now that we have built out this functionality, it's time to see how it fits together.

The backlinks functionality uses the site's search index to track links. The search index gets updated when cron jobs are run. You can run a cron job manually by navigating to http://yoursite.org/cron.php when logged in as a site administrator. If your backlinks are not showing (or any time search gives you unexpected results) triggering a cron job manually can help resolve the issue.

In this section, we will add some sample content to illustrate the functionality we have just built. To start, add some sample student users. For this example, we will add two new studentslucy and helen.

We will then log in as helen and create two new blog posts. Helen's first post is shown in the following screenshot:

Creating the Student Blog in Drupal using Cloning

Copy the URL into your clipboard, and then, while still logged in as helen, create another blog post.

When creating this second post, add a link to Helen's first awesome blog post.

Creating the Student Blog in Drupal using Cloning

To add the link, highlight the text you want to be the hyperlinked, and then click the link icon, indicated by the arrow in the screenshot above. Paste the URL into the Link form, and then click the OK button.

Finally, submit the post.

Next, log out, and log back in again as lucy. As shown in the following screenshot, lucy will click the Student blog link to see what her classmates have been writing.

Creating the Student Blog in Drupal using Cloning

Lucy will read Helen's first awesome blog post, and after being inspired or motivated by helen's post, lucy will create her own post where she links back to Helen's first awesome blog post.

Creating the Student Blog in Drupal using Cloning

At this point, both helen and lucy have linked to helen's first post. When we navigate to this, we will see a screen which looks like the following screenshot:

Creating the Student Blog in Drupal using Cloning

The What links here block that we created earlier in the article shows all posts within the site that link back to this blog post. This allows site members to communicate with one another through comments, or through their own blogs.

Summary

In this article we created the foundation that will support both teacher-led and student-led led interaction. The instructor blog, appearing on the home page of the site, can give structure to the class and provide guidance to students. The student blogs, collected and displayed via the view we created, provides a place for students and teachers to see each other's work, and to provide feedback via comments.

Drupal for Education and E-Learning Teaching and learning in the classroom using the Drupal CMS
Published: November 2008
eBook Price: €20.99
Book Price: €34.99
See more
Select your format and quantity:

About the Author :


Bill Fitzgerald

Bill Fitzgerald was born in 1968, and worked as a teacher for 16 years. During that time, he taught English and History, and worked as a Technology Director at the K12 level. Bill began using technology in his own teaching in the early 90s; from there, he moved on to database design and systems administration. During that time, Bill began developing strategies to support technology integration in 1:1 laptop systems, and in desktop computing environments.

In 2003, Bill and Marc Poris founded FunnyMonkey, a Drupal development shop working primarily within education. Bill started and manages the Drupal in Education group on http://groups.drupal.org, and is active in various educational and open-source communities. Bill blogs about education and technology at http://funnymonkey.com/blog.

When Bill is not staring deeply into computer screens, he can be found riding his fixed gear bicycle through Portland, OR, or spending far too much time drinking coffee.

Books From Packt

Drupal: Creating Blogs, Forums, Portals, and Community Websites
Drupal: Creating Blogs, Forums, Portals, and Community Websites

Drupal 6 Themes
Drupal 6 Themes

Building Websites with Joomla! 1.5
Building Websites with Joomla! 1.5

Joomla! Web Security
Joomla! Web Security

OpenCms 7 Development
OpenCms 7 Development

Drupal Multimedia
Drupal Multimedia

Building Powerful and Robust Websites with Drupal 6
Building Powerful and Robust Websites with Drupal 6

Learning Drupal 6 Module Development
Learning Drupal 6 Module Development

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software