Generico Filter
Maintained by
Justin Hunt
Generico is a simple filter for creating templates of code snippets and text that can be inserted into Moodle text areas.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
{GENERICO:type="accordian"}
{GENERICO:type="accordianitem",titletext="This is one"}
111111
{GENERICO:type="accordianitem_end"}
{GENERICO:type="accordianitem",titletext="this is two"}
222222
{GENERICO:type="accordianitem_end"}
{GENERICO:type="accordian_end"}
{GENERICO:type="accordion_container"}
{GENERICO:type="accordion_card",expanded="false",heading="Level 1"}
1. Test 1
2. Test 2
{GENERICO:type="accordion_card_end"}
{GENERICO:type="accordion_card",expanded="false",heading="Level 2"}
1. Test 1
2. Test 2
{GENERICO:type="accordion_card_end"}
{GENERICO:type="accordion_container_end"}
Can you help me troubleshoot the issue? Thank you.
Warning: Undefined array key 1 in /moodle/www/html/filter/generico/classes/generico_utils.php on line 99
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /moodle/www/html/filter/generico/classes/generico_utils.php on line 100
However, I've only seen this error once and the images don't work on any pages. However, .svg images do display, while .png and .jpg images do not. Do you know what is happening here?
If at any point in the future you want to change how this course header looks, you only have to update one Generico filter, rather than 1000+ courses.
I want to put the "front page" of a course, that appears in 1.000 courses in the template of a Generico Filter - including the variable for the course image.
So that only the template key is in the text field in the course.
If we change anything about the text or position of the image or anything else in the structure of front page in the next years, we only have to do it in the filter template and not in all the courses.
As far as I know, the filter code {courseimage} (or @@COURSE:image@@) does not work in the Generico template.
Do you have a solution for that?
Parsing other filters inside of Generico should still work. I dont think anything changed apart from the parameters that go into the filter string.
However, this particular method is not working on one of my newer sites - I have spent ages checking that the syntax is correct and the filter order is set correctly. The only difference that I can see is my newer site has Generico version 1.4.22 and my other sites are on Generico 1.4.21 or earlier. Looking at the change log for version 1.4.22 it says 'Better cleaning up of filter string inputs to prevent variable injection and meddling' - will this have stopped the filter codes from working inside a Generico filter?
Is there a way that I can get my filter codes working again?
Thanks in advance