Simplifying single section display with tabs

Name

OneTopic (a.k.a. Un tema a la vez)

Module type

Course format

Author

David Herney Bernal GarcĂ­a

Released

2009

Maintained

Actively

Languages

English, Spanish (but should work in any language)

Compliance

Good

Documentation

Online documentation (Spanish only)

Errors

None

This format takes the method of displaying a single topic at a time, used in the standard Topics format, and simplifies this with tabs at the top of each section

Getting ready

Unzip the module's source directory to /moodle/course/format/. You can then use the format straight away.

How to do it...

Visit the Settings page for your course and scroll down in the General settings area to the Format setting. Choose the Topics in tabs format (not to be confused with the Topics Tabs format described earlier), then save the settings.

How to do it...

The OneTopic format, or as it is written in Spanish, the "Un tema a la vez" format, applies a keep-it-simple philosophy to minimizing use of page space, while adding a level of usability not present in the standard Topics format. With the standard Topics format it is possible to select and focus on one topic or week, then move to other sections by selecting them from the Jump to... drop-down menu.

When selected, the OneTopic format forces the course page to be shown one section at a time. To navigate to other sections, the user can click on the appropriate tab at the top of the page. This is more convenient and obvious than the Jump to... menu (which is still made available).

How to do it...

The tabs are named according to the titles of each section on the course page.

How it works...

When a tab is selected, the whole page reloads. This is not as convenient as jumping to the section without having to reload the page, but it works solidly.

The format uses the tabs that are part of the Moodle HTML library, so these will blend in nicely with any theme that you may be using. The tabs will also function as the user expects.

Because the OneTopic format does not attempt to use any fancy dynamic overlay to present the course page, normal Ajax functionality still works as expected, which means you can move, promote, demote, hide, and delete without reloading the page.

There's more...

One aspect that you might wish to change is the numbering on Topic tabs. Because this format is simple, the coding is also easy to change.

Open the file /moodle/course/format/onetopic/format.php and scroll down to line 126 and you should find the following:

'<font style="white-space:nowrap">' . s($section.$strsummary) . "</font>", s($section.$strsummary));

Change this line by removing the $section variable and the full stop used to concatenate this string to the next. You should end up with the following version of the line:

'<font style="white-space:nowrap">' . s($strsummary) . "</font>", s($strsummary));

Scroll up to around line 116 and you will see where the $strsummary variable is set. To remove the dashes from the strings, delete that' - ' and the following concatenation (full stop) operator. Be sure to do this for both the if and else blocks. You should end up with the following lines of code:

if (strlen($strsummary) < 57) {
$strsummary = $strsummary;
} else {
$strsummary = substr($strsummary, 0, 60).'...';
}

After saving these changes, the tabs should appear unnumbered at the top of the course page.

There's more...

Note

If you alter a course format and later update that format with a new version from the author, changes you have made will be overwritten, and will need to be made again.

See also

  • Topics Tabs format
  • Weekly Tabs format
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.239.166