Search code examples
phphtmlmoodlemustache

Title attribute of HTML still render although it has remove in mustache file


I try to remove the title attribute of tag a in the mustache template of moodle framework. But somehow, it still renders the title attribute inside the tag "a" without value or empty value.

<h3 class="lorem-value"><a href="{{url}}">{{{title}}}</a></h3>
<h3 class="lorem-value"><a href="lorem-value" title>Lorem title in there</a></h3>

So, what happened in there? How can we fix that? Thanks


Solution

  • Most likely, you are looking at the cached version of the template or the page uses the template. You have different options to see the new changes taking place.

    • If you are making changes in a production server (which is not recommended) you can use the web interface or the admin CLI to purge caches. From your terminal execute php admin/cli/purgecaches.php of course you have to be in your Moodle root directory. Purge cache from web interface

    • Enable design mode from the appearance theme setting page. Design mode theme setting page

    • Disable cache from config.php file.

      // Prevent Template caching
      $CFG->cachetemplates = false; // NOT FOR PRODUCTION SERVERS!