Moodle 3.1 removes HTML code from front page

Moodle 3.1 removes HTML code from front page

by Davi DePaula -
Number of replies: 2

I have changed my front page to include a Carousel of images. This Carousel is a jQuery plugin that uses CSS. So in my front page I added the following 2 lines:



<link href="https://MyURL/mod.com/FrontPageMod/owl-carousel/owl.carousel.css" rel="stylesheet" /> 

<link href="https://www.MyURL.com/mod/FrontPageMod/owl-carousel/owl.theme.css" rel="stylesheet" />

But when I save and return to the course, Moodle automatically removes the 2 lines of code from my front page making my Carousel not work. 

This issue started after I upgraded from Moodle 2.5 to 3.1. As a matter of fact, the issue only showed up after I went into the HTML editor and did some changes to the code. 


Can someone tell me why the HTML editor is removing the 2 lines of code? It seems that the HTML editor is doing some king of validation and removing the code. 


Thanks in advance.

Average of ratings: -
In reply to Davi DePaula

Re: Moodle 3.1 removes HTML code from front page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

I've come across the problem elsewhere of code being removed when saving a form. To prevent this happening, you can disable the HTML editor by selecting plain text area in your preferences (via your user menu). You should then be able to enter the code and save it without it being removed.

In reply to Helen Foster

Re: Moodle 3.1 removes HTML code from front page

by Davi DePaula -

Thank you Helen for your help. 

I simply changed the HTML editor from TinyMCE to Plain text and it allowed me to put the 2 lines of code into the form.  

Average of ratings: Useful (2)