FilterCodes

Filters ::: filter_filtercodes
Maintained by Michael Milette
Transform your Moodle site with the FilterCodes Plugin! Elevate engagement by inserting over 195 dynamic plain-text tags like {firstname} to create personalized learning experiences, customize your site and course content, display progress bars, simplify Contact Form customization effortlessly and much more. FilterCodes empowers educators to revolutionize Moodle into a dynamic, personalized platform. Join the community of FilterCodes enthusiasts to unlock the potential of your Moodle LMS site.
Latest release:
4945 sites
2k downloads
195 fans
Current versions available: 1

The FilterCodes plugin for Moodle enables you to insert plain text tags like {firstname} into your Moodle site or course content in order to personalize the site to individual students.

Here are just a few examples of the ways you could use this plugin include:

  • Personalize your course content with the learner's name and even their photo.
  • Display certain content depending on the user's role.
  • Conditionally display content depending on whether the user is enrolled in the current course.
  • Create links that normally require the user's ID as part of the URL.
  • Insert default user information into Contact Form for Moodle forms.
  • Display your list of available courses and categories on the Front page (Home page) as cards.
  • Display alert-type boxes.
  • Create your own popup Help just like Moodle does (popup info icon also available)
  • Display the amount of disk space available to Moodle, the number of courses, the number of active students and more.
  • Display several pre-configured templates for use with the Contact Form plugin.
  • Add notes or reminders within your course content - which is only visible when editing the content.
  • Create dynamic and context-aware custom menus for students, teachers, managers and administrators (only supported by a few themes unless you apply a patch).
  • Customize your dashboard with dynamic content.
  • Display course progress bar and percentage.
  • Easily display FontAwesome icons almost anywhere.
  • Display content from the custom user and custom course fields on your course outline page. This can be useful for creating course templates for your organization.
  • Conditionally display content depending on which cohort, group, role or Workplace tenant is looking at the content.
  • Insert support information in every course and manage that information centrally.
  • Easily list teachers, and non-editing teachers (assistants) in your course.
  • Create buttons and charts.

Share with us how you use this plugin on your site.

Development efforts for this project are sponsored by the kind folks at TNG Consulting Inc.. Special thanks go out to several developers who have contributed to the development, documentation and testing of this release of FilterCodes, as well as to those who offered suggestions for many of the new tags. We appreciate your contributions!

Useful links

Once installed and enabled, the following plain-text tags (no HTML required) will become available to you anywhere that Moodle supports filtering.

List of FilterCode tags

Creating FilterCodes Documentation

  • [{ }] : You can escape tags so they are not processed by adding [brackets] around the tag. Can be disabled in the plugin's settings if it causes you problems.
  • [%7B %7D] : You can escape %7Bencoded%7D tags too so they are not processed by adding [brackets] around them.

Profile

  • {firstname} : Displays the user's first name.
  • {surname} or {lastname} : Displays the user's surname (family/last name).
  • {fullname} : Displays the user's first name and surname.
  • {alternatename} : Displays the user's alternate name. If blank, will display the user's first name instead.
  • {city} : Displays the user's city.
  • {country} : Displays the user's country.
  • {timezone} : Displays the user's preferred time zone.
  • {preferredlanguage} : Displays the user's preferred language in that language. Because of this, it will be encapsulated in an HTML span tag with an appropriately set lang attribute.
  • {email} : Displays the user's email address.
  • {userid} or %7Buserid%7D : Displays the user's Moodle ID.
  • {idnumber} : Displays the user's id number from their profile.
  • {username} : Displays the user's username.
  • {userdescription} : Display the user's description.
  • {webpage} : Displays the user's webpage as seen in their profile.
  • {institution} : Displays the name of the institution from the user's profile.
  • {department} : Displays the name of the department from the user's profile.
  • {userpictureurl X} : Displays the user's profile picture URL. X indicates the size and can be sm (small), md (medium) or lg (large). If the user does not have a profile picture or is logged out, the default faceless profile photo URL will be shown instead.
  • {userpictureimg X} : Generates an HTML tag containing the user's profile picture. X indicates the size and can be sm (small), md (medium) or lg (large). If the user does not have a profile picture or is logged out, the default faceless profile photo will be used instead.
  • {profile_field_shortname} : Display the content of a custom profile field. Replace "shortname" with the shortname of a custom profile field all in lowercase. NOTE: Will not display if the custom profile field's settings are set to Not Visible.
  • {profilefullname}: Similar to {fullname} except that it displays a profile owner's name when placed on the Profile page.
  • {firstaccessdate dateTimeFormat} : Date that the user first accessed the site. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {lastlogin dateTimeFormat} : Date/Time that you last logged into the site.

System Information

  • {filtercodes} : Will display the version and release of FilterCodes plugin. Not that this information is only available to those who can edit the tag.
  • {usercount} : Count the total number of registered users on the site. Does not include deleted users, primary admin or guests.
  • {usersactive} : Count the total number of registered users on the site. Does not include deleted users, disabled users, primary admin or guests.
  • {usersonline} : Total number of users who were online in the last 5 minutes.
  • {siteyear} : 4-digit current year.
  • {now dateTimeFormat} : Display the current date. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {coursecount} : Total number of courses on this Moodle site (not including Front Page).
  • {diskfreespace} : Displays the amount of free disk space for the application directory. An infinite symbol will be displayed if greater than about 84,703.29 Yottabyte (YB) or if it fails to get the size from the operating system.
  • {diskfreespacedata} : Displays the amount of free disk space for moodledata directory. An infinite symbol will be displayed if greater than about 84,703.29 Yottabyte (YB) or if it fails to get the size from the operating system.
  • {wwwroot} : Root URL of the Moodle site.
  • {userscountrycount} : Total number of countries that users are from according to their profile.
  • {supportname} : Support name as seen on Site Administration > Server > Support contact.
  • {supportemail} : Support email address as seen on Site Administration > Server > Support contact.
  • {supportpage} : Support page URL as seen on Site Administration > Server > Support contact.
  • {supportservicespage} : Support services page URL as seen on Site Administration > Server > Support contact in Moodle LMS 4.2 and later.

UI Elements

  • {coursecard id} : (ALPHA) Displays an individual course card.
  • {coursecards} : (ALPHA) Displays available courses as cards. Has only been tested on Front Page.
  • {coursecards id} : (ALPHA) Same as {coursecards} but you can specify the top-level category ID number to be displayed.
  • {courseprogress} : (ALPHA) Displays course progress status in words. Only works within a course.
  • {courseprogresspercent}: Displays course progress percentage as a number without a percentage symbol. Only works within a course.
  • {courseprogressbar} : (ALPHA) Displays course progress status as a status bar. Only works within a course.
  • {categorycards} : (ALPHA) Display top-level categories as cards. Has only been tested on Front Page.
  • {courserequest}: Display a Request a Course link.
  • {chart pie}: (ALPHA) : Display a 2-section pie chart.
  • {chart progressbar} : (ALPHA) Displays a progress bar.
  • {chart progresspie} : (ALPHA) Create a (circle / doughnut) progress chart.
  • {chart radial} : (ALPHA) Displays a radial chart.
  • {button url}Label{/button} : Displays link as a button.
  • {hr} : Displays a horizontal rule line.
  • {label backgroundtype}{/label} : Displays text over a colour background.
  • {markborder}{/markborder} : Surrounds text with a red dashed border.
  • {marktext}{/marktext} : Highlight text using HTML5's mark tag.
  • {qrcode}{/qrcode} : Generates and displays a QR Code for the content between the tags.
  • {showmore}{/showmore} : (ALPHA) Toggle showing content between opening and closing more tags.
  • {mycoursescards} : Displays a series of cards for my enrolled courses.
  • {teamcards} : Displays photos, names (optionally linked) and optional descriptions of the users who are teachers. Great for Faculty pages.

For use in courses

  • {coursename} : Displays the full name of the current course or the site name if not in a course.
  • {courseshortname} : Displays the short name of the current course or, if not in a course, the site's short name.
  • {courseenrolmentdate dateTimeFormat} : Date and time at which the user was enrolled in the current course. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {coursestartdate dateTimeFormat} : Course start date. Displays "Open event" if there is no start date. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {courseenddate dateTimeFormat} : Course end date. Displays "Open event" if there is no end date. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {coursecompletiondate dateTimeFormat} : Course completion date. If not completed, will display "Not completed". Will also detect if completion is not enabled. For information on the optional dateTimeFormat format, see Supported dateTimeFormats Formats in the FAQ section of the documentation.
  • {courseprogress}: (ALPHA) Displays course progress status in words.
  • {courseprogressbar}: (ALPHA) Displays course progress status as a status bar.
  • {course_fields}: Displays the custom course fields. NOTE: Respects a custom course field's Visible To setting.
  • {course_field_shortname} : Displays custom course field. Replace "shortname" with the short name of a custom course field all in lowercase. NOTE: Respects a custom course field's Visible To setting.
  • {coursesummary} : Displays the course summary. If placed on a site page, displays the site summary.
  • {courseimage} : Displays the course image.
  • {courseimage-url} : URL of the course image.
  • {courseparticipantcount} : Displays the number of students enrolled in the current course.
  • {courseid} or %7Bcourseid%7D : Displays a course's ID.
  • {coursecontextid}: Displays a course's context ID.
  • %7Bcoursecontextid%7D : Displays a course's context ID - for use in URLs. Only for use in course activity modules.
  • {courseidnumber} : Displays a course's ID number.
  • {sectionid}  or %7Bsectionid%7D : Displays the section ID (not to be confused with the section number).
  • {sectionname} : Displays the section name in which the activity is located.
  • {coursemoduleid} or %7Bcoursemoduleid%7D : Course module ID. Only works inside a course activity or resource module.
  • {coursecontacts} : (ALPHA) List of the course teachers with optional links to their profile, email address or Moodle messaging.
  • {mygroups} : Displays a list of groups to which you are a member.
  • {courseunenrolurl} : The course unenrolment URL for you to place in a button or a link anywhere in the course.
  • {coursecount students} : Displays the number of students enrolled in the course.
  • {coursecount students:active} : Displays the number of users with the role of 'student' in a course who are not suspended in the course.
  • {coursegradepercent} : Displays the current accumulated course grade of the student (no percentage symbol).
  • {coursegrade} : Displays the student's current overall course grade (with percentage symbol).

Categories

  • {categoryid} : If in a course, the ID of the course's parent category, the category ID of a course category page, otherwise 0.
  • {categoryname} : If in a course, the name of the course's parent category, is otherwise blank.
  • {categorynumber} : If in a course, the number of the course's parent category, is otherwise blank.
  • {categorydescription} : If in a course, the number of the description of a course's parent category, is otherwise blank.
  • {categories} : Displays an unordered list of links to all course categories.
  • {categories0} : Displays an unordered list of just top-level links to all course categories.
  • {categoriesx} : Displays an unordered list of other categories in the current category.

Custom menu

Note: Filtering must be supported in a custom menu by your theme. See README.md for more information.

  • {categoriesmenu} : A second-level list of categories with links for use in custom menus.
  • {categories0menu} : A second-level list of just top-level categories with links for use in custom menus.
  • {categoriesxmenu} : A second-level list of other categories in the current category with links for use in custom menus.
  • {toggleeditingmenu} : A Turn Editing On or Turn Editing Off custom menu item. Note that you need to add your own dash(es).
  • {mycoursesmenu} : A second-level list of courses with links for use in custom menus (filtering must be supported by the theme).
  • {courserequestmenu0} : Request a course / Course request in a top-level custom menu.
  • {courserequestmenu} : Request a course / Course request in a submenu.
  • {menudev} : Useful menu for Moodle developers.
  • {menuadmin} : Userful dynamic menu for Moodle administrators, managers and teachers (is context sensitive).

URL

  • {pagepath} : Path of the current page without wwwroot.
  • {thisurl} : The complete URL of the current page.
  • {thisurl_enc} : The complete encoded URL of the current page.
  • {urlencode}{/urlencode} : URL encodes any content between the tages.
  • {referer} or {referrer} : Referring URL
  • {protocol} : http or https
  • {ipaddress} : User's IP Address.
  • {sesskey} or %7Bsesskey%7D : Moodle session key.
  • {wwwcontactform} : Action URL for Contact Form forms. (requires Contact Form plugin).

Content

  • {global_...} : Use your own custom FilterCodes tags in the filter's settings. This is sometimes referred to as global blocks. An example of this might be if you wanted to define a standardized copyright or other text, email address, website URL, phone number, name, link, support information and more. Define and centrally manage up to 20 global block tags.
  • {note}content{/note} : Enables you to include a note which will not be displayed.
  • {help}content{/help} : Enables you to create popup help icons just like Moodle does.
  • {info}content{/info} : Enables you to create popup help icons just like the popup Help icons but with an "i" information icon.
  • {alert style}content{/alert}: (ALPHA) Creates an alert box containing the specified content. You can change the style by specifying an optional parameter. Example: {alert primary} or {alert success}. See List of styles.
  • {highlight}{/highlight} : Highlight text. NOTE: Must only be used within a paragraph.
  • {scrape url="..." tag="..." class="..." id="..." code="..."} : Scrapes the content from another web page. Must be enabled in FilterCodes settings.
  • {getstring:component_name}stringidentifier{/getstring} or {getstring}stringidentifier{/getstring}: Display a Moodle language string in the current language. If no component name (plugin) is specified, will default to "moodle".
  • {fa/fas/fa-solid/fab/fa-brands fa-...} : Insert FontAwesome icon. Note: FontAwesome Font/CSS must be loaded as part of your theme. For FontAwesome v6.0 icons, you need Moodle 4.2+.
  • {glyphicon glyphicon-...} : Insert Glyphicons icon. Note: Glyphicons Font/CSS must be loaded as part of your theme.
  • {mycourses} : Displays an unordered list of links to all my enrolled courses.
  • {myccourses} : Displays an unordered list of links to all my completed courses - only includes courses with completion tracking enabled.

Contact Form templates

The following tags are replaced by Contact Form templates and therefore require that you have the Contact Form for Moodle plugin installed.

  • {formquickquestion} : Adds a "quick question" form to your course. The form includes Subject and Message fields. Note: The user must be logged in or the form will not be displayed.
  • {formcontactus} : Adds a "Contact Us" form to your site (example: in a page). The form includes Name, Email address, Subject and Message fields.
  • {formcourserequest} : Adds a "Course Request" form to your site (example: in a page). Unlike Moodle's request-a-course feature where you can request to create your own course, this tag allows users to request that a course they are interested in be created. Could also be used to request to take a course. The form includes Name, Email address, Course name, and Course Description.
  • {formsupport} : Adds a "Support Request" form to your site (example: in a page). The form includes Name, Email address, pre-determined Subject, specific Subject, URL and Message fields.
  • {formcheckin} : Adds an "I'm here!" button to your course. The form does not include any other fields. Note: The user must be logged in or the button will not be displayed.

Useful for creating Custom Contact Forms and Links

  • {lang} : 2-letter language code of current Moodle language.
  • {recaptcha} : Displays the ReCAPTCHA field - for use with Contact Form for Moodle. Note: Will be blank if a user is logged in using a non-guest account.
  • {readonly} : To be used within form input fields to make them read-only if the user is logged in.
  • {editingtoggle} : "off" if in edit page mode. Otherwise "on". Useful for creating Turn Editing On/Off links.
  • {wwwcontactform} : Action URL for Contact Form forms. (requires Contact Form plugin).
  • {formsesskey} : Not a form. This can be used instead of having to insert the required hidden input field and JavaScript Snippet.

Conditionally display content filters (All versions of Moodle)

Note: {ifrolename} and {ifminrolename} type tags are based on role archetypes, not role short names. For example, you could have a role called students but, if the archetype for the role is teacher, the role will be identified as a teacher. Roles not based on archetypes will not with these tags.

Logged in/out

  • {ifloggedin}{/ifloggedin} : Displays the enclosed content only if the user is logged in as a non-guest.
  • {ifloggedout}{/ifloggedout} : Displays the enclosed content only if the user is logged out or is logged in as a guest.
  • {ifloggedinas}{/ifloggedinas} : Displays the enclosed content only if you are logged-in-as (loginas) a different user.
  • {ifnotloggedinas}{/ifnotloggedinas} : Displays the enclosed content only if you are logged in as yourself and not a different user.

Courses

  • {ifenrolled}{/ifenrolled} : Displays the enclosed content only if the user is enrolled as a student in the current course. This tag does not take any other roles into consideration.
  • {ifnotenrolled}{/ifnotenrolled} : Displays the enclosed content only if the user is not enrolled as a student in the current course. This tag does not take any other roles into consideration.
  • {ifincourse}{/ifincourse} : Displays the enclosed content only if the user is in a course other than the Front page.
  • {ifnotincourse}{/ifnotincourse} : Displays the enclosed content only if the user is not in a course.
  • {ifinsection}{/ifinsection} : Displays the enclosed content only if the user is in a section of a course which is not the Front Page.
  • {ifnotinsection}{/ifnotinsection} : Displays the enclosed content only if the user is not in a section of a course.
  • {ifingroup id|idnumber}{/ifingroup} : Displays content if the user is part of the specified course group ID or group ID number.
  • {ifnotingroup id}{/ifnotingroup} : Displays content if the user is NOT part of the specified course group ID or group ID number.
  • {ifprofile_field_shortname}{/ifprofile_field_shortname} : Displays the enclosed content if the custom profile field is not blank/zero.
  • {ifactivitycompleted id}{/ifactivitycompleted} : Displays content if the activity or resource specified by ID has been completed.
  • {ifnotactivitycompleted id}{/ifnotactivitycompleted} : Displays content if the activity or resource specified by ID has not been completed.
  • {ifinactivity}{/ifinactivity} : Displays enclosed content if the user is currently inside an activity or resource.
  • {ifnotinactivity}{/ifnotinactivity} : Displays enclosed content if the user is not currently inside an activity or resource.
  • {ifvisible}{/ifvisible} : Displays the enclosed content if the course visibility is set to Show.
  • {ifnotvisible}{/ifnotvisible} : Displays the enclosed content if the course visibility is set to Hide.

Roles

  • {ifguest}{/ifguest} : Displays the enclosed content only if the user is logged in as a guest.
  • {ifstudent}{/ifstudent} : Displays the enclosed content only if the user is logged in and enrolled in the course (no other roles).
  • {ifassistant}{/ifassistant} : Displays the enclosed content only if the user is logged in as a non-editing teacher in the current course.
  • {ifminassistant}{/ifminassistant} : Displays the enclosed content only if the user is logged in as a non-editing teacher or above in the current course.
  • {ifteacher}{/ifteacher} : Displays the enclosed content only if the user is logged in as a teacher in the current course.
  • {ifminteacher}{/ifminteacher} : Displays the enclosed content only if the user is logged in as a teacher or above in the current course.
  • {ifcreator}{/ifcreator} : Displays the enclosed content only if the user is logged in as a course creator.
  • {ifmincreator}{/ifmincreator} : Displays the enclosed content only if the user is logged in as a course creator or above.
  • {ifmanager}{/ifmanager} : Displays the enclosed content only if the user is logged in as a manager.
  • {ifminmanager}{/ifminmanager} : Displays the enclosed content only if the user is logged in as a manager or above.
  • {ifminsitemanager}{/ifminsitemanager} : Displays the enclosed content only if the user is logged in as a site manager or above.
  • {ifadmin}{/ifadmin} : Displays the enclosed content only if the user is logged in as an administrator.
  • {ifcustomrole roleshortname}{/ifcustomrole} : Displays enclosed content only if the user has the custom role specified by its short name within the current context.
  • {ifnotcustomrole roleshortname}{/ifnotcustomrole} : Displays enclosed content only if the user does not have the custom role specified by its short name within the current context.
  • {ifincohort CohortID|idnumber}{/ifincohort} : Displays enclosed content only if the user is a member of the specified cohort. You can specify the Cohort ID in your cohort settings or its ID number. Cohort ID can contain a combination of letters from a to z, A to Z, numbers 0 to 9, dash and underscores. It will not work if it contains spaces or other special characters.
  • {ifhasarolename roleshortname}{/ifhasarolename}: Displays enclosed content if the user has been assigned the specified role anywhere in the Moodle site within any context.

Miscellanious

  • {ifdev}{/ifdev} : Displays the enclosed content only if the user is logged in as an administrator and developer debugging mode is enabled.
  • {ifhome}{/ifhome} : Displays the enclosed content only if the user is on the Moodle Home Frontpage.
  • {ifnothome}{/ifnothome} : Displays the enclosed content only if the user is not on the Moodle Home Frontpage.
  • {ifdashboard}{/ifdashboard} : Displays the enclosed content only if the user is on the Moodle Dashboard.
  • {ifcourserequests}{/ifcourserequests} : Displays enclosed contents only if the Request a Course feature is enabled.
  • {ifeditmode}{/ifeditmode} : Displays the enclosed content only if editing mode is turned on.
  • {ifmobile}{/ifmobile} : Displays the enclosed content if it is being accessed from the mobile app or through a Web service.
  • {ifnotmobile}{/ifnotmobile} : Displays the enclosed content if not being accessed from the mobile app or through a Web service.

If the condition is not met in the particular context, the specified tag and its content will be removed.

Conditionally display content filters (For Moodle Workplace)

  • {iftenant idnumber|tenantid}{/iftenant} : Displays the content if a tenant id number or tenant id is specified. Only {iftenant 1} will work in Moodle classic.
  • {ifworkplace}{/ifworkplace} : Displays the content only if displayed in Moodle Workplace.

HTML and "lang" tagging

  • {-} : Is substituted for a soft hyphen that only appears when needed.
  • {nbsp} : Is substituted for a non-breaking space when displayed.
  • {langx xx}{/langx} : Tag specific text in a particular language by wrapping the text in a plain text pair of {langx xx} {/langx} or {langx xx-XX} {/langx} tags. This makes no visible changes to the content but wraps the content in an HTML <span lang="xx" xml:lang="xx"></span> inline tag. As a result, screen readers will use this localization information to apply a particular pronunciation if the text is in a different language than the rest of the page. This is required for compliance with W3C Web Content Accessibility Guidelines (WCAG 2.0)
  • {multilang}{/multilang} : A plain-text substitute for Moodle core's Multi-Language Content filter span tags. For this tag to work, the Multi-Language Content filter must be enabled as FilterCodes doesn't do any language filtering itself. It just makes it easier to tag the text.
  • {details}{summary}{/summary}{/details} : An easy way to create an HTML 5 Details/Summary expandable section on your page. IMPORTANT: {details}{summary}{/summary} must all be on one line (it is ok if the line wraps). The rest of the details can be on multiple lines followed by the {/details}. This experimental feature may result in invalid HTML, but it works.
  • {hr}: Displays a horizontal rule line.

For more information and an up-to-date list of tags, see the README.md documentation file included with the plugin.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Michael Milette (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Michael Milette
    Mon, 27 Nov 2023, 12:32 PM
    Hi Marta,

    The author of Simple Certificate contacted me about this 6 years ago. This is an issue with the way that plugin applies its own tags after having applied a other tags instead of before. At the time, I suggested to the author that he address the issue but, if you are using the latest version of it and it still has this issue, then he did not.

    For more details, see https://github.com/michael-milette/moodle-filter_filtercodes/issues/8

    That said, I am not familiar with that plugin anymore but some Moodle activity modules allow you to enable and disable filters. The option will either be in a gear menu or the secondary menu depending on which version of Moodle you are using. If it has the option just disable FilterCodes for that activity.

    Alternatively the author of Simple Certificate won't fix the issue, you can hire a developer like me to do it. You can reach me at www.tngconsulting.ca/contact.

    Best regards,

    Michael Milette
  • Juan Fortuna
    Fri, 8 Dec 2023, 7:54 PM
    Hello everyone. I have been using FilterCodes for a long time, and at this moment, in my work, I was asked to show some information about the student, including the name of the group to which they belong in the course classroom. I have searched but I can't find if there is the possibility of managing that data. Is there any variable that shows it? Thank you in advance.
  • Dave Foord
    Fri, 8 Dec 2023, 8:05 PM
    @Juan - there is a function for that, it is {mygroups} - this will show a student all the groups they are in.
  • Juan Fortuna
    Fri, 8 Dec 2023, 8:29 PM
    I tried that function, but it doesn't work, and don't know why. There's no errors, just show me {mygroups} but not the group name or names. Maybe you know some tips that helps me. Thank you very much.
  • Michael Milette
    Fri, 8 Dec 2023, 10:27 PM
    Hi Juan, I double-checked and {mygroups} seems to be working as designed. What version of FilterCodes are you using and what version of Moodle are you using?
  • Michael Milette
    Sat, 9 Dec 2023, 2:59 AM
    Hi Juan, make sure that you are using the {mygroups} tag inside a course. It does not work outside of a course. It only lists groups to which you belong within a course
  • Blair F.
    Wed, 13 Dec 2023, 3:23 AM
    Just had a little panic after updating the plugin and all my course end dates were showing up as the start dates. For those who may experience, this, and want the SAME date format that was previously showing (at least for us), I just needed to change the {coursestartdate} and {courseenddate} to {coursestartdate strftimedatefullshort }and {courseenddate strftimedatefullshort}. I thought that the format was optional, but it wasn't in our case. GREAT PLUGIN, though! LOVE THIS!
  • Marta Lopes
    Sun, 17 Dec 2023, 8:02 AM
    Olá Michael, vi na documentação do plugin que temos a tag {preferredlanguage} que exibe o idioma selecionado pelo usuário e a tag {langx xx}{/langx} que marca um texto específico em um determinado idioma envolvendo o texto em um par de tags de texto simples. Uso bastante os blocos html onde tenho textos e uma tag que seria muito útil e ajudaria bastante é a tag {iflang xx} onde o xx corresponde ao idioma selecionado pelo usuário
  • Michael Milette
    Sun, 17 Dec 2023, 6:00 PM
    Olà Marta, sorry, I don't speak Portuguese.

    In order to do language-based filtering, I believe what you are looking for is a multi-language filter.

    I personally use and recommend the excellent multi-language content (v2) {mlang xx}{mlang} tags for this.

    If you prefer not to install another 3rd party plugin, you can use the slightly less flexible {multilang xx}{/multilang} tags included with FilterCodes. This is a plain-text substitute for Moodle core's Multi-Language Content filter that uses HTML span tags.

    Important: For {multilang} tags to work, the Multi-Language Content filter that comes with Moodle must be enabled as FilterCodes does not do any language filtering itself. It just makes it easier to tag your content using plain text tags instead of having to edit HTML.

    If these are not what you are looking for, let me know how your idea of an {iflang xx}{/iflang} would be different.

    Hope you find this information helpful.

    Best regards,

    Michael Milette
  • Marta Lopes
    Thu, 21 Dec 2023, 1:28 AM
    Hi Michael, thank you for your feedback, but what I need are tags with if, for example, if the selected language is Portuguese, "Brazil" will appear and if it is English, "Brazil" will appear. Example: {iflang pt} Brasil {/iflang}
    {iflang en} Brazil {/iflang}, In other words, only what is within the if of the language selected by the user will appear on the screen
  • Michael Milette
    Thu, 21 Dec 2023, 1:33 AM
    Hi Marta, that is exactly what the {mlang} and {multilang} tags do. They just don't have the word "if" as part of the name of the tag. Try them. I am confident that you will not be disappointed.
  • Marta Lopes
    Thu, 21 Dec 2023, 3:12 AM
    Michael, I've already tested it and the 2 options appear with different languages, as there is no if clause, this tag simply translates the text into the language that I allocate in xx, that's all
  • Michael Milette
    Thu, 21 Dec 2023, 5:56 AM
    Hi Marta,

    I am not sure what you are doing but I can assure you that neither of the solutions that I mentioned do any kind of translations on their own.

    I suggest that you move this discussion into the Moodle discussion forums as this does not have anything to do with FilterCodes.

    Alternatively, feel free to reach out to me through my website for premium support at www.tngconsulting.ca/contact and I will be happy to work one on one with you.

    Best regards,

    Michael
  • Marie Waterhouse
    Fri, 5 Jan 2024, 11:25 PM
    Hello,
    I have a question / request.
    I can see {ifhasarolename roleshortname}{/ifhasarolename}: Displays enclosed content if the user has been assigned the specified role anywhere in the Moodle site within any context.
    Is there a 'not' version of this please? ie
    {ifhasnotarolename roleshortname}{/ifhasnotarolename}Displays enclosed content if the user has NOT been assigned the specified role anywhere in the Moodle site within any context.

    Thank you for wonderful plug in, it continues to support our use of Moodle, especially useful for supporting the student.
    With best wishes, Marie
  • Justificado
    Fri, 26 Jan 2024, 4:04 AM
    Guys, why isn't this working for me?
    I downloaded the Plugin, for version 4.3, installed it, the Theme used in Moodle is 'Classic'
    everything ok so far

    Then I tried to do this within a course that has 5 Groups already created and with students in each group.
    HTML Block:
    Your name: {fullname}
    Class: {mygroups}

    |But, nothing changes, it stays the same, no name or group appears here
    What am I doing wrong?
Please login to post comments