When editing HTML tags in the editor in lessons the code does not appear correctly. Especially table setting (Width settings) are ignored in Moodle. I have changed the editor, but that doesn’t seem to have any effect. The same problems also appear in HMTL blocks, so this is obviously an HTML issues. That can be done to avoid this?
HTML code does not appear correctly
Number of replies: 12Re: HTML code does not appear correctly
Hi Skule,
It would help to know some more details. What Moodle version and what theme are you using?
I did not try in blocks, but in Moodle 3.2.1+ and using Boost, Clean, and Binarius themes, HTML width seems to work okay. I used both the Atto editor table toolbutton and HTML templates I created in Justin Hunt's new Snippet tool for the Atto editor.
For this sample picture I have selected the table width to be 50% and each column to be 50% which makes them 25% of the full width.
Svar: Re: HTML code does not appear correctly
Here is the code:
<p>Bruk gjerne maksimeringsknappen nederst til høyre i videobildet for å se videoen bedre.</p>
<p></p>
<p><</p>
<table border="1" align="left" style="width: 800px; background-color: #dddddd;">
<tbody>
<tr><th>
<table border="1" align="left" style="width: 800px; background-color: #dddddd;">
<tbody>
<tr><th colspan="2" scope="row">
<div align="left"><video width="800" height="600" controls="controls"> <source src="http://skule.sormo.no/videos/1t-1-3.mp4" type="video/mp4" /> Your browser does not support the video tag. </video></div>
</th></tr>
<tr><th width="200" scope="col" bgcolor="#FFFF00">Lever oppgavene:<br /> <br /> Oppgave 1.130<br /> Oppgave 1.132<br /> Oppgave 1.230<br /> Oppgave 1.232</th><th width="544" bgcolor="#FF0000"><br /> Regel 1:<br /> I to formlike figurer <br /> er forholdet mellom samsvarende lengder <br /> det samme uansett <br /> hvilke samsvarende lengder <br /> vi velger.<br /> <br /> Regel 2:<br /> I to formlike figurer <br /> er forholdet mellom to sider <br /> i den ene figuren <br /> lik forholdet mellom de samsvarende sidene <br /> i den andre figuren<br /><br /><br /></th></tr>
</tbody>
</table>
</th></tr>
</tbody>
</table>
The code I like to use is this: (But it doesn't appear like this when it is run. The video in the table overrun the width of the table)
|
---|
Re: Svar: Re: HTML code does not appear correctly
Sorry to be so slow to reply, but I have had a really bad cold for the past few days and have not spent too much time looking at emails. Right off hand, it it appears to me that you are trying to place an 800 pixel width video into a table that is also 800 pixels wide. It also appears that you are then trying to put a two column table inside that table, along with the video.
It probably would work better to just use one table, with two rows, and the two cells in row one merged into one cell. Try it like this:
<table frame="border" rules="all" style="border-color: #000000; border-width: 0px; background-color: #f6ed08;" border="0" align="center">
<tbody>
<tr>
<td colspan="2" style="border-color: #000000; background-color: #dddddd; border-style: solid; border-width: 1px;">
<video controls="controls" width="800" height="600">
<source src="http://skule.sormo.no/videos/1t-1-3.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</td>
</tr>
<tr>
<td style="background-color: rgb(255, 255, 0); border-color: rgb(0, 0, 0); border-style: solid; border-width: 1px; text-align: center;">Lever oppgavene:
<br>
<br>Oppgave 1.130
<br>Oppgave 1.132
<br>Oppgave 1.230
<br>Oppgave 1.232</td>
<td style="background-color: rgb(255, 0, 0); border-color: rgb(0, 0, 0); border-style: solid; border-width: 1px; text-align: center;">Regel 1:
<br>I to formlike figurer
<br>er forholdet mellom samsvarende lengder
<br>det samme uansett
<br>hvilke samsvarende lengder
<br>vi velger.
<br>
<br>Regel 2:
<br>I to formlike figurer
<br>er forholdet mellom to sider
<br>i den ene figuren
<br>lik forholdet mellom de samsvarende sidene
<br>i den andre figuren</td>
</tr>
</tbody>
</table>
Svar: Re: Svar: Re: HTML code does not appear correctly
I have tried your
suggestion. The code appear correctly in the editor and as a test file in
Dreamweaver, ran as a standalone html file. But it appears differently after being saved and run in Moodle.
The table width is ignored when the video tag is applied in a table cell. Outside the table tag video tag is not align left when a code for that is applied also. This seems to be a
bug in Moodle. The same problem appear also i HTML blocks in the left/right side of the Moodle screen.
There are also big problems with installed plugins in Moodle. They are deactivated after installation, and I cannot find any way of activate them. Installed PoodLL plugins also causes the Moodle to hang, without any possibilities to remove them. I have to remove them at the server, and that is too cumbersome for such a great software as Moodle. Joomla has a much greater procedure for this.
Re: Svar: Re: HTML code does not appear correctly
Hi Skule,
I pasted your HTML in to a lesson page on my Moodle site and it worked as I believe you expect it to. I wonder is there something in your CSS affecting it?
What version of Moodle are you on, and which theme are you using?
Catherine
Svar: Re: Svar: Re: HTML code does not appear correctly
Moodle version 3.2.1+
Using BSU, Adaptable and Aardvark themes
Re: Svar: Re: Svar: Re: HTML code does not appear correctly
There's some CSS in 3.2 that's not in earlier versions that seems to be causing it:
Svar: Re: Svar: Re: Svar: Re: HTML code does not appear correctly
Which file does this appear? It is possible to edit it to avoid this error?
Re: Svar: Re: Svar: Re: HTML code does not appear correctly
Instead of BSU did you really mean BCU? If so, BCU is listed as compatible with Moodle 2.9 and below. On my Moodle 3.2.1+ site with debugging set to developer level, if I use BCU anyway, on every Moodle page I go to it shows about two pages worth of various notices caused by the render.php file.
Svar: Re: Svar: Re: Svar: Re: HTML code does not appear correctly
Yes, it was BCU, sorry about the mispelling..
yes, when the theme is change the plugins errors dissappeared . So it was assosicated to the BCU theme, obviously. Thank you for great support!
Svar: Re: Svar: Re: Svar: Re: HTML code does not appear correctly
Well, i cannot still install Record Audio (repository_recordaudio) and mediacapture (repository_mediacapture), both plugins are deactivated after installation, and I cannot find any way to activate them. Used the Boost theme. Neither the PoodLL filter and other PoodLL plugins could be installed.
Re: Svar: Re: Svar: Re: Svar: Re: HTML code does not appear correctly
Without access to the server files and to your Moodle, I am at a loss for what to try next. I have more than one server, so it is at this point when I am having trouble with my own Moodle, I compare one against the other until I find the problem.