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:
- Give users in the student role permissions over the blog post content type.
- Clone the teacher_blog view, and edit it to display student blog posts.
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.
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.
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.
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.
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.
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.
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:
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.