michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 45 forks source link

Custom course field not displayed in Home Page and Site administration #190

Closed aleko21 closed 2 years ago

aleko21 commented 2 years ago

Hi, we successfully installed and configured filtercodes plugin to bypass the 255 char limit of the course name (we have many languages to display).

We configured it as follows:

Now the title is displayed correctly in the course home BUT in Home Page and in Site administration the coursename field is returned blank.

How to solve this issue?

michael-milette commented 2 years ago

Hi @aleko21 ,

That is a great idea, except that you discovered the limitation. The FilterCodes tags are context sensitive.

Within a course, it will work because the course knows its own name. However, the home page is technically also a course in Moodle. It knows nothing about your course's custom field names so it appears blank.

If you just have a few courses, you coud try using the FilterCodes global blocks to define names for your courses. The reason you can only do this with a few is because there is currently a 20 global tag limitation.

You can configure your own custom global FilterCodes tags in the FilterCodes settings.

Hope you find this useful.

Best regards,

Michael

aleko21 commented 2 years ago

I've about 100 courses. So it's not possible... This is a huge problem for me.

Do you have any ideas to help me in display the courses list in home page? Can I do something modifying the template?

michael-milette commented 2 years ago

Are you using the Multi-Language Content v2 {mlang} tags instead of the version that come with Moodle? The {mlang} tags are substantially shorter than the HTML span tags leaving more room for additional languages. They are also easier to use.

If you use those instead of the FilterCodes tags in your textarea custom course field, it should display on your home page but you will need to configure this field for each course. The advantage of this solution is that it does not require any programming but it does depend on your theme displaying the custom course field. I would also suggest using a regular text field instead of a textarea as textarea field can introduce unwanted rich text HTML tags.

Other possibilities which require some programming skills which may help you achieve your desired outcome include:

These solutions are listed from most sustainable to least sustainable.

Hope you find something useful in these suggestions.

Best regards,

Michael Milette

michael-milette commented 2 years ago

As there has been no further discussion for over a month, I am closing this issue as it is a limitation of Moodle's filter functionality and there isn't much I can do about it without changing Moodle core. If you wish to re-open this issue in the future, let me know.

Best regards,

Michael