Open PhineasDD opened 3 years ago
Hi @PhineasDD
Where do you put these pages? The reason I ask is because course related tags only show information for the current course. If you try to use them in a site page or in course listings, they will report information for the site and not the course as you would hope. So, as long as that page is an activity in the course, it could work.
You asked for a current date tag but did not include an example of how you would use it.
As for how to make your custom PHP pages be processed through Moodle filters like FilterCodes, you need to always pass your content through the format_text() or format_string() functions before you output it. I recommend you build up all your content first and then put it through one of these functions just before you output it for efficiency.
Student entered content should never be processed through filters but should be just cleaned (a.k.a. sanitized) before it is stored in the database.
For more information on these output functions, see:
https://docs.moodle.org/dev/Output_functions
Best regards,
Michael
Well, for example, if I have a course A, I would like to be able to put a striking description that would attract new clients using the filters that I have listed.
They would be phrases like: "As of {date} this course has a total of {totalquestions} questions" And it would result in: "As of 10/15/2020 this course has a total of 2000 questions.
Currently on my moodle page I show this phrase in many areas and I also have more than 10 courses, so having to manually change all the phrases every week is a lot of effort. For this reason I wanted to know if it would be possible to implement those filters.
I also wanted to propose if custom filters can be made, so that the user could choose a name for the filter and the result that would be displayed, for example: Filter name: {custom-1} Result to display: 1000
In this way the sentences on the total of questions could also be created such that:
"As of {date} this course has a total of {custom-1} questions" And it would result in: "As of 10/15/2020 this course has a total of 1000 questions.
Hi @PhineasDD ,
Please open a separate issue ticket for each suggestion. Otherwise the conversations van get complicated to follow.
With regards to your {custom-1} suggestion, you might want to consider taking a look at the Generico plugin. If I understand what you are asking, that is pretty much what it does and it does so so much better than FilterCodes ever would.
Thank you for providing an example for the usage of a {date} tag.
Please remember to answer my question about where you would use the tags. You will not be able to use most of them in course descriptions (course summary).
Hi @PhineasDD ,
Please note that I recently added a new {now} tag. See the documentation in the README.md file for optional date/time formatting options. This feature is currently only available on the version of FilterCodes here on GitHub and will be included in the next release of FilterCodes on Moodle.org within the next few days.
As for the rest of the tags you suggested, they will need to wait for a future release of FilterCodes. I usually release a new version of FilterCodes with each new major release of Moodle (i.e. every 6 months). If you can't wait, please feel free to contact me through my website at https://www.tngconsulting.ca/contact for paid development.
Thank you again for your suggestions! :-)
Best regards,
Michael
Would it be possible to add the following filters to future updates?
I propose these ideas because I think it would be interesting to be able to show users automatic phrases in course descriptions. In this way, those who offer a paid course will be able to attract more clients:
I also have another proposition about being able to insert the codes in PHP pages. Apart from the Moodle installation, I have pages created with php to show contact forms, course descriptions, who we are, etc. I have noticed that the filters are not working on these pages, is there a way to fix it?
THX!