Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Course contents block.

Course contents block: Difference between revisions

From MoodleDocs
(Installation instructions)
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:


The block automatically extracts a suitable title for every week or topic from the section summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used. If the summary is empty, a customizable text "Unit X" (where X is the number) is displayed. Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title.
The block automatically extracts a suitable title for every week or topic from the section summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used. If the summary is empty, a customizable text "Unit X" (where X is the number) is displayed. Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title.
The block has been written and is currently maintained by [[User:David Mudrak|David Mudrak]]


[[Image:course-contents-block-screenshot.png|thumb|The topic title is automatically extracted from the section summary|400px|left]]
[[Image:course-contents-block-screenshot.png|thumb|The topic title is automatically extracted from the section summary|400px|left]]
Line 8: Line 10:
==Installation==
==Installation==


* Moodle 1.9 - checkout [[CVS for Administrators|CVS]] HEAD branch or download [http://download.moodle.org/plugins/blocks/course_contents.zip the daily build]
There is a public source code repository for the block at [https://github.com/mudrd8mz/moodle-block_course_contents github.com]. You can either clone that repository or just download the latest package there. Follow the instructions provided by github for details but this may be what you want:
 
# cd /var/www/moodlesite/htdocs/blocks
# git clone git://github.com/mudrd8mz/moodle-block_course_contents.git course_contents
 
If your Moodle dirroot is git checkout too, you may want to add the block directory into the list of ignored files:
 
# cd /var/www/moodlesite/htdocs
# echo /blocks/course_contents/ >> .git/info/exclude
 
This plugin requires PHP 5.
 
==Examples==
 
{| class="nicetable"
! <center>Start of the section summary HTML</center>
! <center>Automatic course contents line</center>
 
|-
| <nowiki>Welcome!<br />In this course, you will ...</nowiki>
| Welcome!
 
|-
| <nowiki><h1>Introduction</h1><p>In this course ...</p></nowiki>
| Introduction
 
|-
| <nowiki><h1><span>Lesson 1</span>: Introduction</h1></nowiki>
| Lesson 1


The source codes of the module live in [[CVS for Administrators|CVS]] [http://cvs.moodle.org/contrib/plugins/blocks/course_contents/ contrib/plugins/blocks/course_contents]. To checkout the module, go to the Moodle blocks/ directory and use:
|}
cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co -d course_contents contrib/plugins/blocks/course_contents


==See also==
==See also==
Line 17: Line 46:
* [http://moodle.org/mod/data/view.php?d=13&rid=2156 Modules and plugins database record]
* [http://moodle.org/mod/data/view.php?d=13&rid=2156 Modules and plugins database record]


[[Category:Blocks]]
[[Category:Block]]
[[Category:Contributed code]]

Revision as of 17:03, 28 November 2011

Course contents block is similar to the Simple navigation block. It simply produces a list of all visible topic/week in your course. Clicking at one of these links will display that particular week or topic.

The block automatically extracts a suitable title for every week or topic from the section summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used. If the summary is empty, a customizable text "Unit X" (where X is the number) is displayed. Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title.

The block has been written and is currently maintained by David Mudrak

The topic title is automatically extracted from the section summary


Installation

There is a public source code repository for the block at github.com. You can either clone that repository or just download the latest package there. Follow the instructions provided by github for details but this may be what you want:

# cd /var/www/moodlesite/htdocs/blocks
# git clone git://github.com/mudrd8mz/moodle-block_course_contents.git course_contents

If your Moodle dirroot is git checkout too, you may want to add the block directory into the list of ignored files:

# cd /var/www/moodlesite/htdocs
# echo /blocks/course_contents/ >> .git/info/exclude

This plugin requires PHP 5.

Examples

Start of the section summary HTML
Automatic course contents line
Welcome!<br />In this course, you will ... Welcome!
<h1>Introduction</h1><p>In this course ...</p> Introduction
<h1><span>Lesson 1</span>: Introduction</h1> Lesson 1

See also