Meta course: How to hide yet make accessible

Meta course: How to hide yet make accessible

על ידי Diane Villemure בתאריך
מספר תגובות: 2

Following from the (now closed) discussion, I am grateful to Nicholas Bovee who offered in 2015:

In the CSS, I simply used the "data-courseid" attribute to target the metacourses I wanted to make invisible on the front page. This is manageable if you only have a few specific courses you want to keep invisible.

For example: #frontpage-course-list .coursebox[data-courseid="116"] {display: none;}

To hide the metacourse not only on the frontpage but also on the category page, I added the following code to my theme's CSS (in this example, the metacourse number is 27):

.coursebox[data-courseid="27"] { display: none; } /* this hides the metacourse but still allows enrolment */

To hide the metacourse from the "My courses" area of the Navigation block:

.block_navigation .block_tree .tree_item[data-node-key="27"] { display: none; } /* this hides the metacourse from the "My courses" list in the Navigation block */

HOWEVER, if you want to display the course description on the enrol page (in my case, paypal/enrol.html, you need to hack the core file with:

<?php if($course->id == "27") { ?>

<style type="text/css">
.coursebox[data-courseid="27"] { display: block; }
</style>

<?php } ?>

ממוצע דרוגים: -
בתגובה ל: Diane Villemure

Re: Meta course: How to hide yet make accessible

על ידי Diane Villemure בתאריך

To avoid having to hack an enrolment file to see the course description, I recommend to replace:

.coursebox[data-courseid="27"] { display: none; } /* this hides the metacourse but still allows enrolment */

with:

#frontpage-course-list .coursebox[data-courseid="27"] { display: none; }
#page-course-index-category .coursebox[data-courseid="27"] { display: none; }

NB: "27" in this example is the metacourse number I want to hide.

Also, to eliminate the confusion of not having the same number of courses displayed than the category total, I added:

.numberofcourse { display:none; }

to my theme's CSS.




בתגובה ל: Diane Villemure

Re: Meta course: How to hide yet make accessible

על ידי Diane Villemure בתאריך

One little addition, if "Combo List" is selected for how the items will be displayed on the site's front page, you need to add this line in your theme's css:

#frontpage-category-combo .coursebox[data-courseid="27"] { display: none; }