HTML with placeholders
- Moodle 3.9–3.11
- 更新 2021-10-11
This is pretty much a copy of core block_html, but with the possibility to use placeholders in HTML content.
What is this?
This is pretty much a copy of core block_html, but with the possibility to use placeholders in HTML content.
A lists of known placeholders with their default values could be preconfigured on a site level .
There is some logic involved for figuring out what value needs to be set for each of the placeholders.
1. Try to get values from URL ( if that happens then those values are saved for the user).
2. Try to get values from user preferences.
3. Fall back to the default values from config.
Helper page
There is a complimentary page included with this plugin. This page uses my dashboard layout and can be used as an
additional page for providing some information as well as setting up some placeholders for users
(even if you don’t have html_placeholders b lock on this page).
The page can also be used just for setting up your placeholders for a user and then redirecting to any of the Moodle pages.
Using Shortcodes
This plugin supports shortcodes (see https://moodle.org/plugins/filter_shortcodes ).
To be able to utilise this feature you require filter_shortcodes plugin to be installed in your Moodle. Then you can wrap your placeholders into [htmlplaceholder] tag in any HTML content across your site.
Example:
[htmlplaceholder]{{profession}}[/htmlplaceholder]
Examples
1. Your Moodle front page has an instance of html_placeholders block with {{profession}} placeholder in its content.