Closed Brada65 closed 2 years ago
Hi @Brada65 ,
As requested, I have added the new {button URL}Label{/button} tag. Here are 3 examples:
The last one will create a button called "Dashboard", using the Moodle language strings, with a link to /my in your Moodle site, regardless of where Moodle is installed (root or subdirectory). The result will be (colour may vary depending on your theme):
This new feature is currently only available in the version of FilterCodes available here on GitHub. This feature will be included in the next release of FilterCodes on Moodle.org around the same time as Moodle 4.0, currently expected in December 2021.
If you would be so kind, I would appreciate it very much if you could test the new {button} tag and let me know whether or not it works for you and meets your needs.
Best regards,
Michael
Thank you Michael, on your quick response. Here are result on my local moodles first one is just bare 3.11 with your theme, and filtercodes.
Second one is my 3.9 with Adaptable theme and lot of other plugins, but same result.
Based on last example "Dashboard" on both platforms, I think it is something in URL that is causing this.
Best regards,
Vladimir
One more result from real situation, tag added to discussion forum description to lead to the next lesson page.
Resulted with this.
I hope this will be helpful too.
Best regards,
Vladimir
Hi @Brada65
Copy the examples into notepad and the copy and paste them into Moodle. Either that or type the text manually. The problem is that Github is turning the plain text into links and then pasting that HTML into Moodle.
Another possibility might be caused by Moodle automatically turning URLs into links. It is a filter in Moodle which is enabled by default in Moodle 3.9+. Other than turning the filter off, I am not sure how to avoid this.
Please let me know which of these is the problem and if you have any suggestions.
Best regards,
Michael
You were 100% right. If you unlink url in editor it is showing the button.
It must be manually entered, first try was copy url and paste, the next one is manually entered (look at the button :)).
Great work!
Thank you again,
Vladimir
Thanks Vladimir. I should probably include that tip in the documentation :-)
It helps also if order of filters are set in a certain way. "Filter Codes" need always to be before "Convert URLs into links and images"
It was my pleasure to work with you,
Vladimir
Thanks for the tip! I usually have FilterCodes near or at the top of the list of filters.
The documentation has been updated to include the suggestion of unlinking the URL in the WYSIWYG editor. See: https://github.com/michael-milette/moodle-filter_filtercodes#why-does-the-button-tag-not-work
This feature will be published on Moodle.org around the time of the release of Moodle 4.0 expected in December 2021.
Thanks again for your help!
Michael
It would be great to have filter code for a primary button like "Continue" in the lessons.
Of course option of the custom name of the button will be much better (your idea).
As we already talked it should be like this:
{button https://google.ca}Continue{/button}
Thank you!