Copied to clipboard

Flag this post as spam?

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


  • Prasad joshi 35 posts 55 karma points
    Jan 04, 2011 @ 07:52
    Prasad joshi
    0

    div tag problem

    Hi,

    I am write the <div class="clr"></div> in the content but when i will goes for save and publishing the content the <div class="clr"></div> will disappears and there is nothing in place of that.

    Please help me out.

    Thanks in advance.

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 04, 2011 @ 09:01
    Kim Andersen
    0

    Where do you write this empty div-tag Prasad?

    If you are using it in the richtext editor, I'm pretty sure that the TinyMCE will strip the tag as it's not allowed in here. If you are using it in XSLT, the div will collapse if you have the output set to XML.

    So where do you write this empty tag?

    /Kim A

  • sun 403 posts 395 karma points
    Jan 04, 2011 @ 09:18
    sun
    0

    in xslt, you should set output to html

  • Prasad joshi 35 posts 55 karma points
    Jan 04, 2011 @ 09:35
    Prasad joshi
    0

    hey kim,

     I am write the empty div in richtext editor.

    Is there is any soluction??

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jan 04, 2011 @ 09:57
    Michael Latouche
    0

    Hi Prasad,

    Maybe you can check the content of the config file for TinyMCE. It is located in /config/tinyMceConfig.config and it contains the definitions of which tags/attributes are allowed.

    You can find all details about this at the following url: http://tinymce.moxiecode.com/wiki.php/Configuration:valid_elements

    If you look at the default rule set specified at this url, and which is probably the one in your tinyMCEConfig.config file, it contains the element "-div", the "-" meaning that empty elements will be removed at save time, like you experience.

    My guess is that, if you change the "-div" by "div[class]", you should get the expected result.

    Remember to touch the web.config file to apply the changes.

    Hope this helps.

    Cheers,

    Michael.

  • Prasad joshi 35 posts 55 karma points
    Jan 04, 2011 @ 10:11
    Prasad joshi
    0

    hi mike,

    I checked what u r sayed i found -div[id|class|style] so i just modify like that div[id|class|style] but still it not work for me..

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jan 04, 2011 @ 10:24
    Michael Latouche
    0

    Strange :-S

    Did you make sure you touched your "root" web.config so that the changes were actually taken into account by iis (or do a iisreset if this is on a dev/test server)?

  • Prasad joshi 35 posts 55 karma points
    Jan 04, 2011 @ 10:31
    Prasad joshi
    0

    hi mike,

    Please explain what should i do with root web.config for this.

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jan 04, 2011 @ 10:38
    Michael Latouche
    0

    Hi Prasad,

    For example you can just add a white space somewhere in the file (where it does not break anything :-)), just so that its date and content gets changed. That way IIS will see this as a site configuration change and "reset" the site, taking your new tinyMCEConfig file into account.

    Cheers,

    Michael.

  • Prasad joshi 35 posts 55 karma points
    Jan 04, 2011 @ 10:49
    Prasad joshi
    0

    yet the same thing is going on the empty div will be going to disappears... 

  • Prasad joshi 35 posts 55 karma points
    Jan 11, 2011 @ 12:08
    Prasad joshi
    0

    Not solved

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 11, 2011 @ 12:15
    Jan Skovgaard
    0

    Hi Prasad

    Have you tried to disable tidy in the umbracoSettings.config?

    /Jan

  • Prasad joshi 35 posts 55 karma points
    Jan 11, 2011 @ 12:21
    Prasad joshi
    0

    Hey jan,

    thanks once again i just make it false and its woring now...

  • Jon Kelling 2 posts 22 karma points
    Apr 09, 2011 @ 18:15
    Jon Kelling
    0

    I believe the problem is not with the XSLT, but with the browser. An empty XML tag, i.e. will properly translate to <div> in the output; however, the browser does not accept <div/>, which is why you end up with a single <div> instead.

    Setting output to HTML seems like a possible solution, but it's really not the responsibility of XSLT as far as I understand. I saw a post about using <xml:text></xml:text> to fix it, but that shouldn't really do it either, since you still have an empty tag.

    Maybe this explanation will help someone find a solution.

  • Jon Kelling 2 posts 22 karma points
    Apr 09, 2011 @ 18:20
    Jon Kelling
    0

    I believe the problem is not with the XSLT, but with the browser. An empty XML tag, i.e. <div></div>, will properly translate to <div /> in the output; however, the browser does not accept <div />, which is why you end up with a single <div> with no closing tag instead.

    Setting output to HTML seems like a possible solution, but it's really not the responsibility of XSLT as far as I understand. I saw a post about using <xml:text></xml:text> to fix it, but that shouldn't really do it either, since you still have an empty tag.

    Maybe this explanation will help someone find a solution.

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2011 @ 19:41
    Jan Skovgaard
    0

    Hi Jon

    I'm not sure what you mean?

    In the XSLT file you can define the output method. If it's set to XML it will generate xml output, which will turn <div></div> into <div /> in the rendered source, which can mess up the site because it collapses.

    If the output is set to HTML then <div></div> will be rendered as <div></div>.

    As you write it's not neccesary to change the output method to HTML and and sometimes it not the ideal solution either so using <xsl:text> </xsl:text> instead is often a trick that is used to to avoid that the layout gets messed up if there is no output.

    Just my 2 cents.

    /Jan

  • Garfed 1 post 21 karma points
    Apr 14, 2011 @ 06:48
    Garfed
    0
    If you are using a text editor, I'm sure, TinyMCE will remove the mark, because it is not allowed here. If you use XSLT for the div will collapse, if you have set for the XML output..
    [url=http://www.buymaplestory.com]MapleStory Mesos[/url],[url=http://www.kcq.com/Runescape.gold]RS Gold[/url]
    [url=http://www.wly.com/Runescape.gold]Runescape Gold[/url],[url=http://www.zyy.com/]Buy Cheap WoW Gold[/url]

  • Daniel Bardi 927 posts 2562 karma points
    Apr 14, 2011 @ 08:44
    Daniel Bardi
    0

    You can always through in a space between the tags, but not my first choice

    <div>&nbsp;</div>

     

Please Sign in or register to post replies

Write your reply to:

Draft