2

When creating tinymce with following content

<div><p>123</p></div>

you can't edit any content outside that div.

I can't find a way to add something before or after the div. Is this could be fixed somehow programmatically?

Here is sample (i styled div to show the problem): http://fiddle.tinymce.com/n3caab

BoomyJee
  • 61
  • 2
  • 8

2 Answers2

1

Now 2017, and the problems are the same. Found a simple way - insert mnemonic &zwj; on the sides of the div. Unlike &nbsp; this does not take up too much content. Meanwhile, ckeditor solved this problem with tooltip "insert paragraph here".

0

If you want to make user avaible to write on the start or end of content, just simply add &nbsp; on where it's needed.

There's a way how to avoid user to delete them. You can write javascript function and set it to execute when content is being changed. The function can check if the user isn't doing what he shouldn't.

You can also make special button on tinmce panel for it. I think that solution before is more elegant, but it can also have it's problems.

Community
  • 1
  • 1
user35443
  • 6,309
  • 12
  • 52
  • 75
  • this way tinymce wraps each space with

    and i don't want this paragraphs exist untils user may decide to create them

    – BoomyJee Dec 16 '12 at 13:52
  • and user can delete those paragraphs and then he will be in the same situation - how to insert smth before div – BoomyJee Dec 16 '12 at 13:55
  • What spaces are you talking about? I think that tinymce does it everytime it needs or everytime when it's directly or indirectly ordered to do that. If you want to have as less content, as it's possible, create your own clearing function in javascript. – user35443 Dec 16 '12 at 14:01
  • i am talking about   - it's a space and it's is a part of content and user can delete it – BoomyJee Dec 16 '12 at 14:05
  • Yes. And whats wrong with it? Do you want to make user ever avaible to write on the end of content? – user35443 Dec 16 '12 at 14:06
  • user can delete it and return to situation when nothing can be inserted before div – BoomyJee Dec 16 '12 at 14:07
  • Ah. And you want some special programming way how to do it. The only solution which can I see is to add the special button to tinymce panel for creating empty spaces when the user deletes default ones. Otherwise have a luck with looking for special way how to do it. – user35443 Dec 16 '12 at 14:09
  • Yeah, i'm looking for some programming solution, i'll edit question to clear that – BoomyJee Dec 16 '12 at 14:10