Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • fed 199 posts 70 karma points
    Aug 07, 2009 @ 08:28
    fed
    0

    richtextedtior acting strange

    Tried posting yesterday too, but post dissapeared?

    Basically, we have a rich-text editor on a doc-type. The field gets automatically populated with some default data looking like this:

    <table>
        <tbody>
            <tr>
                <th><strong>Heading 1</strong></th> <th><strong>Heading 2</strong></th>
            </tr>
            <tr>
                <td class="level1">&nbsp;</td>
                <td class="normal">0</td>
            </tr>
            <tr>
                <td class="level2">&nbsp;</td>
                <td class="normal">0</td>
            </tr>
        </tbody>
    </table>

    When I save the page using Firefox, the non-breakingspace is removed. But still the page displays correctly and everything is fine.

    However when the client saves the page in IE7 / IE8 since there is no content in the "level1" and "level2" tablecells they are completely removed. So the result of the save is this:

    <table>
    <tbody>
    <tr>
    <th><strong>Heading 1</strong></th> <th><strong>Heading 2</strong></th>
    </tr>
    <tr>
    <td class="normal">0</td>
    </tr>
    <tr>
    <td class="normal">0</td>
    </tr>
    </tbody>
    </table>

    I know I can probably fix this by inserting a simple transparent image in the cell or something, but I got curious as to why this happens. And also why it seems to be a browserbased error?

    Any ideas?

     

     

  • Chris Koiak 700 posts 2626 karma points
    Aug 07, 2009 @ 09:30
    Chris Koiak
    101

    Hi Fed

    This is more than likely the default behaviour of TinyMCE. No idea why it is browser based, that seems very odd.

    As a quick fix you could try adding a '&nbsp;' into the td to see if this also works.

    However I think the better solution will be in either:

    http://tinymce.moxiecode.com/punbb/viewtopic.php?id=11741

    or

    http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements

     

    Remember to bounce your application after making changes to config/tinymce.config

    Post Disappearing - I've noticed some issues if I use FF with this forum. I've started to use IE for all posts (!).

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 07, 2009 @ 09:30
    Peter Dijksterhuis
    0

    It happens with tables in Internet Explorer (sometimes Firefox as well, I think dependant on the version).

    I have a site that has a pretty large table on a page. My client complained about it a few times but I don't have a real solution except that I tell my client to put a space in each empty cell. Every now and then he forgets it and then he calls me to fix it again.

    What IE does somehow is to completely remove the cell when it's empty. It could be that tinyMCE has a fix for that now (they seem to have fixed the errors when trying to expand the table as well) but I haven't had time to check this.

    If anyone else has a solution for this, I'm interested as well.

  • Chris Koiak 700 posts 2626 karma points
    Aug 07, 2009 @ 09:33
    Chris Koiak
    0

    Quick fix suggestion: Add some default text like 'PLEASE CHANGE ME' into the empty cells. This will remind the client as well as potentially solving your problem.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 07, 2009 @ 09:40
    Peter Dijksterhuis
    1

    Chris, thank you for the post! 

    I quickly tested something. I openend tinyMceConfig.config. I changed the -td and -th into #td and #th (which replaces empty tags by putting a space in it). Touched web.config and tested.

    It seems to do the trick! (tested in IE8 and my empty cell now isn't removed but returns with a space in it)

  • fed 199 posts 70 karma points
    Aug 07, 2009 @ 09:45
    fed
    0

    Hehe, I also modified the tinyMceConfig.config and got it working. Thanks!

  • Roel Snetselaar 151 posts 305 karma points
    Aug 10, 2009 @ 09:12
    Roel Snetselaar
    0

    @Peter seems like a nice solution, gonna give it a try as well.

  • Stigmata86 6 posts 25 karma points
    Aug 26, 2009 @ 16:39
    Stigmata86
    0

    Have tried both #div and div instead of -div.

    When I edit the text in te tinyMCE - <div></div> stays, but it disappears when I try to save or publich the page.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 26, 2009 @ 16:42
    Peter Dijksterhuis
    0

    Did you restart the application after you changed the config-file? If you didn't, the changes don't take effect.

    You can restart the application the easiest way by adding a space somewhere in the web.config and saving it.

    HTH,

    Peter

     

  • Stigmata86 6 posts 25 karma points
    Aug 27, 2009 @ 09:28
    Stigmata86
    0

    Restarted umbraco application, then pool, then server - nothing helped. Tried FF and IE browsers - the same.

    When I open tinyMCE and enter <div></div> and then press update - tags stay, but as soon as I save and publish the whole page - these tags disappear.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 27, 2009 @ 10:06
    Peter Dijksterhuis
    0

    Just tried it and you're right, it strips the div. It does work if you add an id or class to it though.

    Perhaphs you could look at tinyMCE if they have seen that behaviour and maybe they have a solution.

    HTH,

    Peter

  • Stigmata86 6 posts 25 karma points
    Aug 27, 2009 @ 10:10
    Stigmata86
    0

    If I add class to div - still disappears, but if id is added - everything's ok.

Please Sign in or register to post replies

Write your reply to:

Draft