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.
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.
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.
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.
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)?
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.
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.
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.
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.
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..
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.
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
in xslt, you should set output to html
hey kim,
I am write the empty div in richtext editor.
Is there is any soluction??
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.
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..
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)?
hi mike,
Please explain what should i do with root web.config for this.
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.
yet the same thing is going on the empty div will be going to disappears...
Not solved
Hi Prasad
Have you tried to disable tidy in the umbracoSettings.config?
/Jan
Hey jan,
thanks once again i just make it false and its woring now...
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.
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.
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
[url=http://www.wly.com/Runescape.gold]Runescape Gold[/url],[url=http://www.zyy.com/]Buy Cheap WoW Gold[/url]
You can always through in a space between the tags, but not my first choice
<div> </div>
is working on a reply...