HTML with placeholders

Blocks ::: block_html_placeholders
Maintained by Catalyst IT, Dmitrii Metelkin
This is pretty much a copy of core block_html, but with the possibility to use placeholders in HTML content.
Latest release:
34 sites
10 downloads
7 fans
Current versions available: 1

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.

https://example.com/?profession=Doctor -> will replace {{profession}} with Doctor

https://example.com/?profession=Nurse -> will replace {{profession}} with Nurse

2. Your Moodle front page has an instance of html_placeholders block with {{profession}} and {{type}} placeholders in
its content.

https://example.com/blocks/html_placeholders/landing.php?redirect=/&profession=Doctor&type=On-line -> will set profession and type for a user and then redirect to the front page, where will replace {{profession}} with Doctor and {{type}} with On-line

Credits and thanks

This plugin was sponsored by OET Online:

https://oetonline.net.au/

This plugin was developed by Catalyst IT Australia:

https://www.catalyst-au.net/


Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Catalyst IT (Lead maintainer)
Dmitrii Metelkin
Please login to view contributors details and/or to contact them

Comments RSS

Comments

Please login to post comments