Front page - limit number of displayed courses

Is there any way to limit the number of the displayed courses on the front page (when not yet logged in) as right now we have over 200 courses displayed and it does take some time to load all of them.

Hi @mslyon
I think this should give you the result you’re looking for, change the number to a value that best represents your preferences.

You can modify this with a patch like so:

from tutor import hooks

# Set a limit to the number of courses displayed on the homepage
hooks.Filters.ENV_PATCHES.add_item(
    ("openedx-lms-common-settings", "HOMEPAGE_COURSE_MAX = 10")
)

save it as $(tutor plugins printroot)/limit_homepage_courses.py (or your preferred filename) and activate with tutor plugins enable limit_homepage_courses followed by a stop/start of the platform: tutor local stop && tutor local start -d

AMAZING !!! works great ! Exactly what I neded - pity that such things are poorly documented…

Patches are explained here: Creating a Tutor plugin — Tutor documentation

Toggles are explained here: Feature Toggles — edx-platform documentation

Hi @sarina
This particular setting/toggle seems that it’s undocumented, I only found it by searching through the platform code.
I did log an issue 37585 on Git to put some eyes on updating the docs :slight_smile: