Insert html templates

Insert html templates

de Lorena de la Flor -
Número de respuestas: 2

One of the problems I've found with Moodle is that it doesn't support xsl templates to format your contents in any way. It means than each user can format their contents as they want, wich is very nice if every one knew a little bit about style, what is not the usual thing.

To try to avoid a little this point it can be a point to include in the HTML area a button to insert html directly as a template of the contents. In that way, user that don´t kow well how to format contents, can insert a template and start including the texts.

I have done this and included just 4 templates (picture on left, on right, on top and 2-columns) but I pretend to create a more complete set of templates with pre-made html for:

  • Theme objetives list
  • Did you know...?
  • To know more ..

I attach the code just in case you find it useful. To install it place the files in the same folders that are in the zip file from your site root path. (Only english and spanish)

Any suggestions will be welcomed!!

Lorena.

(PD: More about this subject in http://moodle.org/mod/forum/discuss.php?d=21058)

Promedio de valoraciones: -
En respuesta a Lorena de la Flor

Re: Insert html templates

de Enrique Castro -
Imagen de Core developers Imagen de Particularly helpful Moodlers
Hi Lorena,
I think this may be a good solution while waiting for true XHTML templates in Moodle. I have got only an overview, you are using tables for formating and providing some demo text and pictures.

But, I have not been able to use it because the "choose template" window is too, too, small, and not resizeable. I only see three or four words, no more. In IE it's non functional at all: you cannot go to check one of the radio buttons and then the "enter" button. In Mozilla/Firefox you can scroll (that's how I have got an idea), but it is unworkable as it is.

Do you link your templates to some user-editable CSS file, how about linking the templates to the editor styles?

- Enrique -
En respuesta a Enrique Castro

Re: Insert html templates

de Lorena de la Flor -

Hi,

The size of the window is defined in /lib/editor/dialog.js at line 41, maybe you didn't replace the file. I attach it again, just in case I forgot to do it in my first post.

I have found the problem, dialog.js must be in \moodle\lib\editor not inside popups as I included in the zip structure.

The templates that I have made are very simple, and just with tables (I am not web designer so probably it could be done better). But any one can create their own templates to fix their needs.

Of course with xhtml and css it will be better, nicer and accesible ...

I wanted this not only for the style but algo to include certain template of contents. For example, Template "Introduction" with some fixed paragraphs: intro, objetives, bibliography, ...

Lorena.