Courses lists upgrade to 2.5: Difference between revisions
Line 90: | Line 90: | ||
====Tree of categories and courses==== | ====Tree of categories and courses==== | ||
* category page (except case listed above) | * category page (except case listed above) | ||
* 'Courses' page (/course/index.php without specifying category id) | |||
* categories tree on the front page | * categories tree on the front page | ||
* combo list on the front page | * combo list on the front page | ||
All those listings show not only courses but also subcategories, either expanded or not. | |||
{| class="nicetable" | {| class="nicetable" | ||
Line 243: | Line 246: | ||
</code> | </code> | ||
|} | |} | ||
====Pages, displaying information about one course only==== | ====Pages, displaying information about one course only==== |
Revision as of 01:57, 13 March 2013
There are significant changes in course-related functions and UI in 2.5. This document is aimed to assist migration from 2.4 to 2.5. This is NOT a complete documentation on 2.5 features.
Theme developers
All course listings are now performed through the same renderer functions.
There are significant changes to CSS classes used
Pages that are affected by the new renderer functions
To test your theme make sure that your site has several course categories with courses. Also some courses have summaries. Some courses should have enrollment methods other than manual (i.e. self enrollment). Some courses should have enrolled users with roles listed in $CFG->coursecontact. See screenshots attached to MDL-37009
Pages and responsible renderer functions:
- Courses lists on frontpage (see $CFG->frontpage, $CFG->frontpageloggedin) - core_course_renderer::courses_list_frontpage()
- List of courses where user is enrolled (please note, this is no longer recommended setting, use 'my' page instead!)
- List of all available courses
- Categories list ($CFG->maxcategorydepth will affect how many subcategories levels to display)
- Combo list ($CFG->maxcategorydepth will affect how many subcategories levels to display)
- View courses (/course/index.php, /course/category.php) - core_course_renderer::course_category()
- Category is empty
- Category has only subcategories
- Category has only subcategories and there are more than $CFG->coursesperpage of them
- Category has only courses and there are less courses than $CFG->courseswithsummarieslimit
- Category has only courses and there are more than $CFG->courseswithsummarieslimit but less than $CFG->coursesperpage
- Category has only courses and there are more than $CFG->coursesperpage
- Category has both courses and categories and at least one of the lists is bigger than $CFG->coursesperpage (make sure to click "more" link for both courses and categories list).
- Search courses - core_course_renderer::search_courses()
- No courses found
- Less than $CFG->coursesperpage courses found
- More than $CFG->coursesperpage courses found
- Courses with tag - core_course_renderer::tagged_courses()
- Enable tag functionality, tag some courses with the same tag, add Tags block, click on tag name, the list of tagged courses is displayed (this is very similar to search results)
- Course information (.course-info-box) - core_course_renderer::course_info_box()
- If course has self enrollment, when student clicks on course name he is redirected to /enrol/index.php
- In collapsed courses listing there is an "i" icon next to the course name, click on it, /course/info.php is opened
Hint. To change $CFG->xxx type xxx in the search box in Administration block.
CSS classes hierarchy
Listings of courses only where courses information is expanded:
- search results
- tagged courses
- list of enrolled or available courses on the front page
- category page where category does not have subcategories and number of courses is less than $CFG->courseswithsummarieslimit
Moodle 2.4 | Moodle 2.5 |
---|---|
|
*/
|
Tree of categories and courses
- category page (except case listed above)
- 'Courses' page (/course/index.php without specifying category id)
- categories tree on the front page
- combo list on the front page
All those listings show not only courses but also subcategories, either expanded or not.
Moodle 2.4 | Moodle 2.5 | Comments |
---|---|---|
Combo list on frontpage
|
| |
Categories list on frontpage
| ||
Category view with subcategories
| ||
Category view with paginated courses
or category with more than $CFG->courseswithsummarieslimit courses
| ||
/course/index.php
|
Pages, displaying information about one course only
- /course/info.php
- /enrol/index.php (in Moodle 2.4 had url /course/enrol.php)
Moodle 2.4 | Moodle 2.5 |
---|---|
|
*/
|
Some common CSS rules that need to be changed
2.4 | 2.5 | Comments |
---|---|---|
.coursebox | .course_category_tree.courses-only .courses .course, .course-info-box .course | May be also without .courses-only |
.coursebox .teachers | .course_category_tree .courses .course .course-contacts, .course-info-box .course .course-contacts | |
.coursebox h3 | ||
.coursebox .info | .course_category_tree.courses-only .courses .course_link | |
.coursebox .summary | .course_category_tree .courses .course .course-summary | |
.categorylist | May be removed, was used for categories-only list on frontpage | |
.categorylist .category .indentation | .course_category_tree .category .subcategories | |
#page-course-category .courseboxes, #page-course-index .courseboxes | .course_category_tree.courses-only .courses | |