Hi

I want to use a div tag around two paragraphs. There was an old post with an workaround to add inside the div a li and then a h3 or something, but i dosnt work anymore.
I need the following Code

<div class="wrapper">
  <img src="source.img" class="float-left" />
  <p>
    Name<br />
    Address<br />
  </p>
  <p>
    Telephone<br />
    Telefax<br />
    mail@mail.com
  </p>
</div>

I can't just float the image to the left, because the image is higher then the floatet text and between all the divs is a orange line, with a padding to separate the Portraets, with name and address. And the wrapper uses for that also the overflow-hidden or a clearfix class to do the float proper.

I tried now for 3 hours to get this work, but didnt found a solution. Any ideas how to wrap a block element around an other? There are many other cases where i could use the technique to wrap a div or p around other elements. I know i could use views, but it's to complicated to handle in this case and dosn't really make sense in my example.

Sorry for my bad english... but i hope you'll understand my question.
Thanks
Pierre

Comments

TwoD’s picture

I don't think TinyMCE support this natively. TinyMCE does have the "Layer" button which inserts a DIV, but think it will just insert anything if it's not already in a div. You might have to switch to source mode and add the nested divs manually.
I browsed the TinyMCE forums a bit and posts going back a couple of years also mention this problem, but they've been unanswered or lead to plugins which have been discontinued.

sun’s picture

Status: Active » Closed (won't fix)

Sorry, but this request is too custom/specific to be handled by the maintainers of this project.

I'd recommend to post this question in the Drupal forums or on http://drupal.stackexchange.com instead. Also see http://drupal.org/community for other support channels.

Thanks,
sun

alanom’s picture

Status: Closed (won't fix) » Closed (duplicate)

This basic feature request - allowing wrapper elements to be defined - is now going on over here: #1665986: Adding additional Block Formats (e.g. HTML5 elements) in CSS fieldset on text filter setting page does not make them available.

The same TinyMCE features that allow HTML5 elements to be used can also allow wrapper elements to be used (also some of the HTML5 elements are themselves wrappers).

The approaches used to create HTML5 wrapper elements can also be used to create a plain ol' wrapper div in TinyMCE.

p.s. in answer to the question of whether TinyMCE does this natively: it has done since 2010, see a discussion in http://www.tinymce.com/forum/viewtopic.php?id=20319 - the native feature is introduced about half way down.