CLAMP-IT / moodle-blocks_filtered_course_list

The Filtered Course List Moodle block displays a configurable list of courses.
8 stars 10 forks source link

Multilingual content in Title of Filter #153

Closed siven-xtn closed 4 years ago

siven-xtn commented 4 years ago

When creating a filter and adding a title, multilingual content using span as described here does not work.

For example, when adding a regex filter with titles in English and French:

regex | expanded | All coursesTous les cours | .

The HTML content will display as heading.

kwiliarty commented 4 years ago

Thanks for pointing this out, @siven-xtn .

HTML gets stripped out of the rubric titles, but I can make a change to apply filters before stripping HTML so that the multilang markup will apply as expected. I'll work on that.

In the meantime, you could work around this issue by using a plugin like multilang2 https://moodle.org/plugins/filter_multilang2 . That plugin lets you use tags like {mlang en}string{mlang} in place of the HTML markup. That approach already works in the filtered course list.

Important note: Whichever multilang filter you use, you will need to make sure in "Manage filters" that you allow it to apply to headings as well as to content. See: https://docs.moodle.org/39/en/Managing_filters#Managing_filters_at_site_level

kwiliarty commented 4 years ago

My initial idea for a solution was overly simplistic, and it breaks some existing behaviors. Applying the filter based on HTML tags is unfortunately at odds with the existing way of handling the rubric titles. I'm having trouble finding a solution that doesn't seem hacky. I think I am going to say that we can't support the HTML-tag version of multilang for rubric titles. In that case using the non-HTML multilang2 solution would be the way to go. I'm going to close this issue as "won't fix" but feel free to reopen it if you want to discuss it further.