Enable new filters in course discovery search

Hello

I want to enable filtering by “subject”, “course & programs” and “schools & partners” in the search page.

I cannot find any documentation about how to set this features. I think I will need 2 things:

  • Know how to set this properties in each course
  • Know how to enable this properties in the search page

This is what I have

This is what I want

Thanks for any help you can provide me

Regards

1 Like

The default course catalog is…super limited.

EdX.org’s isn’t using the Open edX course catalog, it’s using its own marketing site frontend and the edX discovery service with a Drupal (last I heard) site on the front.

You might want to check it out for ideas - https://edx-discovery.readthedocs.io/en/latest/index.html or https://github.com/edx/course-discovery - but basically if you want a decent catalog, you’re better off building one yourself using the APIs.

1 Like

Thanks Matthew

I’ve been searching and found two possible overrides:

  1. Adding the properties to the Course Model code as suggested in slack https://openedx.slack.com/archives/C08B4LZEZ/p1574679602051300?thread_ts=1574673684.049900&cid=C08B4LZEZ
  2. Enabling custom course settings and reading the property in the filters code as seen here https://www.edunext.co/articles/discover-open-edx-ironwood/

On paper, I prefer the second one because the first requires a modification in some core code, but I have to try.

Thanks for the help, I’ll try to post my solution, if I find it…

Hi @Yago, did you manage to get any solution to this? I also wanted to achieve a similar feature (i.e having subjects/categories) in Open edX courses.

Thanks

Hi @arafay_knysys

First of all sorry for the late response, I was very busy at the moment and just forgot to reply to you :disappointed:

I finally filter all in the front page with Javascript. I just do not manage to do it any other way, so I just show all the courses, add a “data” attribute for each element of the list with whatever data I need and with jquery filter the items based on that data values.

You can see it running here https://uamx.uam.es/courses

In fact if you open Developer’s Tools and inspect the code in courses.html, the scripts are at the bottom of the page with some comments. Yeah, I know I should put it outside and minimize/uglify them, but hey, there you have it to copy/paste whatever you might need :wink:

I am not sure if this is the right solution but was the one I found

My apologies again, good luck with this!

2 Likes

Hi @Yago
Thank you very much for sharing this issue.
I have a question for you. I am trying to implement the filters “org”, “models” and “languages”.
So what I did it was create a pluging called custom_enable_course_discovery.yml in which I enable the variable from lms/envs/common.py called ENABLE_COURSE_DISCOVERY.
The problem is that in my webpage appears the bar refined research but I does not appear the org, models, and language. I search about this and I saw that the variable COURSE_DISCOVERY_FILTERS is always commented and maybe that´s why it does not appear. My question is how can I uncomment this variable? Because it appears in common.py, devstack.py and devstack_descentralized.py and I do not think is recomendable to edit directly files which are .py

Hi @Andres1 . I am sorry but I have changed of project and currently I just dont remember… Maybe my old post about searchs can be useful Problems enabling Open edX Search - #3 by Yago Maybe you can search for this issue in Slack and ask there if someone has found the solution.

BTW I use to do a big search for variables, for example from /edx, to find where the variable is set and used. Check out How to use grep command in UNIX / Linux {With Examples} if like me you have bad memory :stuck_out_tongue:

Good luck!

1 Like

Thank you so much!! :grinning_face_with_smiling_eyes: