Skip to content

Feature Request: Add an admin setting to disable the {teamcards} tag #362

Description

@tonijoki

Prerequisites

  • I am requesting the new feature to the correct repository.
  • I checked the latest version on GitHub and the README.md documentation to ensure that this functionality does not already exist.
  • I searched to make sure that this feature has not already been requested.
  • I have, or I know someone who has, the ability and willingness to test the new feature on a Moodle LMS-based site.
  • I agree to submit one feature request per issue ticket (do not submit multiple requests in one issue ticket).
  • I understand that development and support is provided by volunteer(s) and that all final implementation decisions are up TNG Consulting Inc.

Feature Request - The User Story

As a Moodle administrator, I want to disable only the {teamcards} tag while keeping the rest of FilterCodes enabled.

In our real use case, we use FilterCodes in Moodle content areas and want to keep the plugin available. During testing, {teamcards} displayed user cards for course contacts, including names and profile pictures/avatars. On a larger production site this could unintentionally expose a site-wide staff/contact directory.

We can temporarily hide the output with CSS, but that is not a proper solution because the cards may still be rendered in the page HTML. A server-side setting would prevent the user lookup and rendering entirely.

This would let sites use FilterCodes safely while opting out of the site-wide {teamcards} directory feature when it does not fit their privacy or data-minimization requirements.

Screenshots / Mock-ups

Summary

Please consider adding an admin setting to enable/disable the {teamcards} tag separately from the rest of FilterCodes.

The plugin is useful and we want to keep it enabled, but {teamcards} can unintentionally expose a site-wide directory of course contacts. On larger Moodle sites, the tag may render many users and can reveal names, profile pictures, descriptions, and possibly contact links depending on configuration.

Current behaviour

{teamcards} displays users anywhere on the site who have one of the roles selected in:

Site administration > Appearance > Course > Course contacts

There are currently settings for the team card link type and format, but not a setting to disable only this tag.

Why this setting would be useful

Some sites need FilterCodes generally, but do not want a single tag to create a site-wide staff/contact directory.

This is useful for:

  • privacy and data minimization
  • preventing accidental disclosure of staff/contact lists
  • large sites where {teamcards} can render a very large number of users
  • sites where content editors can add filtered content but should not be able to create site-wide user directories

CSS can hide the output visually, but it is not a proper fix because the user data may still be present in the page HTML. A server-side setting would avoid generating the cards and avoid the database query.

Proposed behaviour

Add a checkbox setting:

Enable {teamcards} tag

Default: enabled, to preserve backwards compatibility.

When disabled, {teamcards} should be replaced with an empty string and the plugin should not perform the user lookup or render the cards.

Proposed implementation

Add a setting such as:

$name = 'filter_filtercodes/enableteamcards';

### Alterative you have considered

_No response_

### Additional information

_No response_

### Planning on submitting a solution in a pull request (PR)?

Yes

### Code of Conduct

- [x] I have read and agree to the project's <a href="../blob/master/CODE_OF_CONDUCT.md" target="_blank">code of conduct</a>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions