Generico Filter icon

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.
Price option: Free

Supports Moodle 2.1-5.2 See all versions
Latest release: 9 months ago
Installations: 2564
Downloads (last 90 days): 558

Frankenstyle name: filter_generico
Filters

Comments

Comments are no longer open for new posts. Existing comments remain available to read.

Hi Justin. Loving the Plugin, it's really powerful. Just a quick (hopefully) question. I know a user can set the variables when they select the template in the Genero Atto plugin (or just type it), and I know you can also set a default for variables, but is there any other way to change the variable?
Example: I have some text in a p tag, and I basically want THAT text to be the content for one of the variables. I've got JQuery to isolate and copy the text, but I can't seem to figure out a way to get this text to become the variable (so a subsequent SQL query uses this new variable in it's select statement).
Hope that all makes sense.
Cheers.
Richard
Hi Justin. Apologies, I think I misread from the Moodle Docs. I've been having a bit more of a play with it and it's been working perfectly. This plugin's been an absolute life saver!
Hi Richard, Its not really as you describe. The full set of values returned from a DB query are returned in the dataset. Only the first set of these is available in the template body, because we would need to figure out a way to reference the array of data from there, since its just html not js. And there is no way to loop from html either.
So if your query returns an array of data you need to access it from the JS field. And set it to HTML from there. The results will be in the @@DATASET@@ variable.
Perhaps you are referring to the situation where your query does not return a unique ID as the first field in each row in the query result set. In that case when it put into json and back out again everything gets written to row 0 in the array (ie you just get one row). In that case you should make sure your result set contains a unique id as the first field in the result set.
Hi there,
Do you know if there's an ETA on a fix for the bug that only passes the first set of variables specified in the Dataset variables to the plugin.
Love the plugin so far, it's really helpful!
Richard
Hello Justin,
Thank you very much for taking the time to answer me. My question sounded a bit silly, but I wasn't sure. Now I am in the right direction.
Your plugin is awesome.
Hi Dominique. The reason that will not work is that the filters are processed by PHP when the page is prepared and before it is sent to the browser. At that time any CSS or JS that the template deems necessary is also added to the page. Your script is running in the browser after all the processing is over and there is no way to send the template back up to PHP for another round (that I know of).
The way you really want to do this, is to add that JS to set content to the div, inside the template. Or even just add the content to the template body. When the filter string is put on the page, and the page displayed your template will be run and any content/js or CSS will be sent to the browser. Encapsualting all your login in the template is how it is supposed to work. You can do quite a lot within Generico, but just get the basics working first.
Hello Justin,
It is possible to load a Generico template into a Moodle page from JavaScript?
I tried:
document.getElementById('tag-id').innerHTML = '{GENERICO:type=foo-template}';
but it doen't work.
Hi Justin,
Thanks for quick reply. I had verified every thing, like presence of Generico and all of its subdirectories in all (two) running instances and in source of AMI image being used, permissions of Generico directory. While setting investigation, when I opened page .../admin/plugins.php?updatesonly=1, it started working.
Generico is just a plugin and does not do anything special with the file system or database. So in this case I think one of your instances does not have Generico filter installed in the program directory, ie it is based on an AMI image that is old. Or at least one of your instances has changes not reflected in the AMI.
Hi,
We are using Generico Version 1.4.10(Build 2019071300) with Moodle 3.3.2 (Build: 20170911). We have AWS Auto Scaling environment, Generico was working fine for a long time.
Suddenly, we started getting "generico - Missing from disk!", but Generico is present in project. After some time it started working. Do you have any idea why did it happened.
Hi Javier, the default line chart template just supports one series. There is another chart library called Chartist that is also in Generico. You can create it from a preset, since it is not set up by default. This can show multiple lines, but its not that great actually because you can not define the range and series labels are not set up. It works better with other chart types. With a bit of work I could fix it up, but that wont be soon.
Hi there,
Is it possible to create a Line Chart with multiple lines? If so, how? I can't manage to do it :s i.e. to compare two different cities.
Thanks!
Hi Justin, thank you very much for this amazing plugin. I would like to ask if you have any idea for this problem: When anybody uses the global search by Moodle they are going to see the plain text tags. Do I have to filter the filters out of the search? Any idea? Thank you very much!
Hi,
awesome plugin!
Passing by to note that custom profile fields only works if their shortnames are in lower case. Didn't find it elsewhere, have to read the code, so noting here smile
Hello, I'm a private music teacher who is very excited about Moodle... BUT lost as to how to solve a problem. I need a simple way to show individual students information that is only for them. When each logs in, they see only what they need. Even though several students are enrolled in the same course ("Level 3" perhaps), I want each to log in and see the recording from their own lesson. Is this something I could use the Generico filter for? I read the documentation and I was still a little fuzzy on it. Thanks!