Block elements inside a div with either MicroTiny or TinyMCE

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
cowtan
Forum Members
Forum Members
Posts: 70
Joined: Mon Jan 19, 2009 5:04 pm

Block elements inside a div with either MicroTiny or TinyMCE

Post 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>
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

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

Post 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.
cowtan
Forum Members
Forum Members
Posts: 70
Joined: Mon Jan 19, 2009 5:04 pm

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

Post 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?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

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

Post 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.
Post Reply

Return to “Modules/Add-Ons”