Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Blog 2.0: Difference between revisions

From MoodleDocs
Line 20: Line 20:
This requires the creation of a new table, in which the associations are recorded.
This requires the creation of a new table, in which the associations are recorded.
Tracker issue: MDL-14408
Tracker issue: MDL-14408
Capabilities:
*moodle/blog:associatecourse
*moodle/blog:associatemodule


=== Improved navigation ===
=== Improved navigation ===

Revision as of 06:59, 30 September 2009

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

Moodle 2.0


Description of improvements

Who can view blog entries?

Blog entries are either in draft mode (only the author can view it), or in public mode. In public mode, everyone on the entire site can view the blog entry.

At one stage in 2.0 development there was an attempt to restrict who can view certain blog entries, based on course enrolment and capabilities. However, after extensive discussion and feasibility testing it became clear that this would lead to serious performance and usability issues, and would turn the blog into something more akin to a forum. It was thus decided to make all blogs public. (See MDL-19676)

An admin setting can allow for blog entries to be accessible by non-logged-in users, for the purpose of publishing and RSS feed aggregation.

Associations

A blog entry can optionally be associated with a course. This makes it possible for a user to blog "about" that course. All blog entries associated in that way can be viewed on a page like blog/index.php?courseid=3. This type of filtering of blog entries does not take into account course enrolments.

Additionally, blog entries can be associated with activity modules, in which case the blog entry is automatically associated with the module's course.

This requires the creation of a new table, in which the associations are recorded. Tracker issue: MDL-14408

Capabilities:

  • moodle/blog:associatecourse
  • moodle/blog:associatemodule

Improved navigation

Before 2.0, the navigation for any listing of blog entries was either "Site > User > Blogs" (for a user's blog entries) or "Site > Blogs" for the whole site's blog entries, optionally filtered by tag. With the new association features, we need a better way to display what type of blog listing we are looking at, based on the parameters passed to blog/index.php. The navigation should also reflect additional filters such as tag and search.

External blogs

A user can import blog entries into Moodle from external blogs. The external blog's entries are copied into Moodle when the external blog URL is entered, and a cron task periodically checks these external blogs to copy new entries not yet entered in Moodle. The period of time between checks can be adjusted as an admin setting.

These external blogs are a user preference, and two types of tags can be added to each of them: "External tags" and "Moodle tags":

  • External tags are used to filter the external blog entries that get copied into Moodle. They must match the tags used by that external blog.
  • Moodle tags are automatically added to each blog entry copied into Moodle from an external blog that uses such tags. This makes it easier to distinguish which of a user's blog entries come from an external blog.

This requires the creation of a new DB table. Tracker issue: MDL-19683

Search blog entries

It is now possible to search blog entries using a search box. The results maintain the current context, so that if you are viewing a list of blog entries for a particular user, entering a term in the search box will return only the blog entries for that user that match the search term. The search term also appears in the navigation breadcrumbs.

Tracker issue: MDL-19686

Contextual blog menu

Previously, the "blog menu" block was the same on every page on which it appeared. In 2.0 it changes depending on which page you are. For example, if you are on course/view.php, it will include a link to blog entries associated with that course. Also, the link for adding a new entry will include the courseid, making the course association automatically pre-selected in the blog entry edit form.

Tracker issue: MDL-19687

File attachments

The new file manager must be implemented to allow for multiple file attachments per blog entry.

Tracker issue: MDL-19744

Comments

The new Comments API makes it possible for anyone having the correct capability to comment on blog entries.

Tracker issue: MDL-8776

New "Recent blog entries" block

This block can be configured to display the last N blog entries, filtered by context. For example, if you are viewing an assignment activity, this block would display the last N blog entries that are associated with that assignment.

Tracker issue: MDL-19688

Potential problems and limitations

DB Structure

2 new tables need to be added: blog_external and blog_association

blog_external

Field Type Default Info
id int(10) auto-incrementing The unique ID for this external blog.
userid int(10) The owner of the external blog
name char(255) A descriptive name for the external blog. Automatically fetched during initial import, can be overridden.
description text(small) A long description of the external blog. Automatically fetched during initial import, can be overridden.
url text(small) The URL to the external blog (e.g. http://moodle.org/rss.xml)
timemodified int(10)
timefetched int(10) The last time the entries from this external blog were fetched by Moodle.

blog_association

Field Type Default Info
id int(10) auto-incrementing The unique ID for this blog entry<->contextid association.
contextid int(10) The context id defined in context table - identifies the instance of the course or plugin associated with the blog entry.
blogid int(10) The id of the blog entry (from the post table) being associated with a course or module instance

Upgrade process

The only task required by the upgrade process is to install the new DB tables.

See also