When i create static block magento wraps content with <p>
tags. Which is very bad for DOM.
Is is possible to remove it somehow. I suppose it is some javascript but i don't know which one.
相关问题
- confusion over System.Web.HttpContext.Current
- Magento 1.7.0.2 Index Management overwriting URL R
- Magento: Best way to avoid extension conflicts
- How to use polymorphism or inheritance in static c
- Magento Fatal error: Maximum execution error solut
相关文章
- Private static variables in php class
- Passing static array in attribute
- Java “static import” vs. “import static” in Java 8
- Magento, translate validation error messages
- Why does Java's List have “List.toArray()”, bu
- How to apply Static Weaving Ant Task with Eclipse-
- Magento API order id vs. increment id
- Unique constraint violation on Magento 1.4.0 to 1.
edit js/mage/adminhtml/wysiwyg/tiny_mce/setup.js
A more user-friendly method would be to catch the
cms_page_render
-event, and use a regular expression to 'unwrap' the widget:config:
observer:
This would unwrap the widget out of their paragraphs prior to Magento's execution of them.
Edit: the part between {{ and }} should be non-greedy.
Actually wrong on my earlier answer.
You need to turn the static block WYSIWYG editor off-by-default.
Go to System -> Configuration, find General section on left hand side, click on Content Management and set 'Enable WYSIWYG Editor' to 'Disable by default' from list.
Then edit your static blocks carefully - use the WYSIWYG but check your HTML afterwards.
This behaviour is a standard feature of WYSIWYG editors, that is what they are for, the
<p>
tags are added in because they make nicely formatted text. Clearly this is not what you want if you add a static block containing just an image, so step out of the editor and check for<p>
tags.The WYSIWYG editor can also mangle variables entered into the static blocks, and it slows down admin page load times, therefore it is best to have it turned off by default.
This depends on where you are using your static blocks and what templates/theme you are using. Turn on the developer frontend hints, load your offending pages, identify the template file used and then pull out the
<p>
tabs from your phtml files.A directly called static block does not put extra
<p>
tags in.