## Blocks: HTML (on profile field selector)

block_profileselectorhtml
Maintained by Valery Fremaux
This block is a combined variant of the profilespecifichtml block and the editablecontenthtml block. It provides way to distribute specific content to several classes of users splitted by matching rules upon one or two profile fields (standard or customized).
192 sites
2 fans

### Contributors

• Tue, 10 Sep 2013, 3:23 AM
Valery - Many thanks for sharing this block with the Moodle community. Consider adding a screenshot (perhaps of the page to configure a blcok showing the conditions). The block installs and functions well. The only thing that surprised me was that I expected the text for all students to appear below the text for those that meet the criteria (only because that information is entered second. Consider moving the order in the edit_form so that config_text_all comes before config_text_nomatch to be consistent in the display order. Also, I noticed that the block did not seem to be dockable or have the normal block actions that I would have expected. This could be because of the jquery css you have. I think it would be nice if the block behaved exactly as other blocks (including the core HTML block). Also, there was a validation warning about multiple readme files. When you get a chance, you will probaby want to remove either README.md or readme.txt. I'm going to approve this plugin and let you or Wafa fix up these issues when you have a moment. Peace - Anthony
• Tue, 10 Sep 2013, 3:24 AM
p.s. - It would be nice if we could create a documentation page too when time permits
• Wed, 25 Feb 2015, 12:54 AM
Hello - Any plans to make this available on 2.7?
• Wed, 25 Feb 2015, 5:59 AM
Hi, at firsdt glance i do not see any drastic reason those blocks would not work on 2.7, By the way, let me time to do a simple check and commit reviewed 2.7 version...
• Sat, 14 Nov 2015, 4:30 AM
To get this work in newer version of Moodle you need to change line 27 in block_profileselectorhtml.php
from :

if (!$context = get_context_instance_by_id($this->instance->parentcontextid)) {

to:

if (!$context = context::instance_by_id($this->instance->parentcontextid)) {
• Thu, 11 Feb 2016, 3:47 AM
And I forgot, also needs doing in li.php around line 58.

Change :

if ($parentcontext = get_context_instance_by_id($birecord_or_cm->parentcontextid)) {

To:

if ($parentcontext = context::instance_by_id($birecord_or_cm->parentcontextid)) {
• Thu, 27 Oct 2016, 11:49 PM
Will there be an updated version for 3.1? Or is there another plugin for an HTML block for dashboard that can be restricted by profile fields?