michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 43 forks source link

Feature request: Add setting to show hidden user profile fields #228

Closed yvanleduc closed 1 year ago

yvanleduc commented 1 year ago

It will be nice to have in the setting of the plugin the option to show hidden profile field for the tag {profile_field_shortname}.
Sometimes it is not relevant to have information in the profile page but it can be in the context of a course. By being able to hide the field, there would be more flexibility for the display. Thanks

michael-milette commented 1 year ago

Hi @yvanleduc ,

Can you give me a real-life example of how you would use this feature?

Best regards,

Michael

yvanleduc commented 1 year ago

Hi Michael

The person responsible for a student's academic record is called CFS here. We have a course (Conseils en formation scolaire) in which the student can see who his CFS is and communicate with her (him).

We need 2 profile fields for this:

nom_cfs: the name of the CFS ( a text field) cfs: the ID (the one in the user table) of the cfs (use in a link)

Actually, both fields are visible to the user.

This is the student view:

[image: image.png]

This is the html code view:

<h5>{firstname}, votre conseiller(ère) en formation scolaire est {profile_field_nom_cfs}<br>.</h5>
<p><i>Notez que si son agenda est complet, vous pouvez utiliser le&nbsp;<i>bloc "Contacter votre" , à droite sur cette

page pour rencontrer un(e) autre conseiller(ère). Cliquez alors sur sa photo pour prendre un rendez-vous.


Contacter

Note that the profile field cfs is obtained by the plugin Dropdown dynamic menu profile field and that the id is not shown but the data related to il (name of cfs) is shown. So, in the database, cfs contain an id, not a name.

[image: image.png]

In the example here the field nom_cfs = Tamara Bernard and the field cfs = 10363

In his profile, the student sees:

[image: image.png]

As you can see there is repetition which is not desirable.. "Tamara Bernard" appears twice. If the "nom_cfs" profile field was hidden, we would not see it in the course "Conseils en formation scolaire" or on the profile, not what we want. However, we want it to appear in the course but not in the profile.

This is the reason why having an option to show a hidden profile field would be useful...it gives us a control of where a hidden profile field can be shown.

If you need more details don't hésitate to communicate with me.

Best regards

Yvan

michael-milette commented 1 year ago

Hi @yvanleduc ,

If I add this option, this new setting would affect FilterCodes globally. All hidden custom profile fields would become available in all courses when using FilterCodes tags. Do you understand and agree that this would be acceptable?

TIP: If possible, please respond on GitHub and not by email. The images you included in your message did not come through and some of the formatting was lost. Your reply also included the footer in your email which had link to unsubscribe you (I removed it). Probably not what you want to share.

Best regards,

Michael

yvanleduc commented 1 year ago

Hi Michael,

Here is my last comment with the pictures. I completely agree and fully understand that all hidden fields can become visible in courses using this option. For our school, the courses are set up by administrators who understand this concept. Thanks


The person responsible for a student's academic record is called CFS here. We have a course (Conseils en formation scolaire) in which the student can see who his CFS is and communicate with her (him).

We need 2 profile fields for this: nom_cfs: the name of the CFS ( a text field) cfs: the ID (the one in the user table) of the cfs (use in a link)

Actually, both fields are visible to the user.

This is the student view:

image

This is the html code view:

image

Note that the profile field cfs is obtained by the plugin Dropdown dynamic menu profile field and that the id is not shown but the data related to il (name of cfs) is shown. So, in the database, cfs contain an id, not a name.

image

In the example here the field nom_cfs = Tamara Bernard and the field cfs = 10363

In his profile, the student sees:

image

As you can see there is repetition which is not desirable.. "Tamara Bernard" appears twice. If the "nom_cfs" profile field was hidden, we would not see it in the course "Conseils en formation scolaire" or on the profile, not what we want. However, we want it to appear in the course but not in the profile.

This is the reason why having an option to show a hidden profile field would be useful...it gives us a control of where a hidden profile field can be shown.

If you need more details don't hésitate to communicate with me.

Best regards

Yvan

michael-milette commented 1 year ago

Hi @yvanleduc ,

Great news! The new setting you requested to show hidden profile fields using the {profilefield...} tag has been added to FilterCodes. You will find a new "Show hidden profile fields" setting in the FilterCodes settings.

At the moment, this new feature is only available here on GitHub. Could you please try it out and let me know if it works for you? If it does, this feature will be included in the upcoming release on moodle.org around the launch of Moodle 4.1 in about a month.

Best regards,

Michael

yvanleduc commented 1 year ago

Thanks Michael, I will of course test this new feature. For installing from github do I just copy everything under the "Code" tab to the "/public_html/filter/filtercodes" directory on our server? Or are there other things to do?

Thanks again

Yvan

michael-milette commented 1 year ago
  1. In Github, click the green code button and then Download Zip.
  2. As a site administrator in Moodle, navigate to Site Administration > Plugins > Install Plugin.
  3. Upload the ZIP file onto this page and complete the instalation process.
yvanleduc commented 1 year ago

Thanks Michael,

Tested on moodle 3.5.6+ for the label ressources. It works great.
If I ever encounter a problem with this feature, I will let you know.

Your plugin is a must for customizing the display.

Great job !!

michael-milette commented 1 year ago

Thanks for getting back to me @yvanleduc. Much appreciated.

Thanks again for your suggestion.

Michael

michael-milette commented 1 year ago

Hi @yvanleduc ,

This setting is now also available on Moodle.org. Thanks again for your suggestion!

Best regards,

Michael