Page 1 of 1

Block elements inside a div with either MicroTiny or TinyMCE

Posted: Thu May 15, 2014 4:07 pm
by cowtan
Hi - On the pages I'm working on there can be a number of different sections each containing some text elements. Each page can have any number of these different sections.

The obvious (to me anyway) to do this was to have a number of <div> elements in the page each with a collection of <p>, <ul> etc elements within it.

This looked fine in theory but I can't find a way of implementing it in practice using either the MicroTiny editor or TinyMCE. Both of them expect text to only ever be within one block level element.

Does anybody know if there's a way I could customise either of these editors so that I can create a <div> element and then create the text elements within it so that at the end of the day the code looks something like -

Code: Select all

<div>
<p>Mary had a little lamb.</p>
<p>Its fleece was white as snow</p>
</div>

Re: Block elements inside a div with either MicroTiny or Tin

Posted: Thu May 15, 2014 4:44 pm
by velden
In my opinion it's better not to let editors make those 'complex' constructions.

Consider using a module for that.
You could use a module like ListitExtended (a.k.a. LI2 a.k.a. Listit2). Add a text area field to it and e.g. a ContentPages field.
That way editors can add as many 'blocks' as they want and select the page where it should appear on.

Just an example of an approach.

Re: Block elements inside a div with either MicroTiny or Tin

Posted: Fri May 16, 2014 8:12 am
by cowtan
Thanks for the suggestion and I agree with what you say about 'complex' constructions. I'll have a go with ListIt2 and see if I think that will work.

Do you know if there are other modules that do similar things?

Re: Block elements inside a div with either MicroTiny or Tin

Posted: Fri May 16, 2014 8:51 am
by velden
News module could be used too.
However, I like ListitExtended better because it's more flexible, you can create multiple instances and give those a nice name.

If you're building more websites you will definitely like this module.