Magento静态块.删除包装< p> [英] Magento static blocks. Remove wrapping <p>

查看:75
本文介绍了Magento静态块.删除包装< p>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建静态块时,magento用<p>标签包装内容.这对DOM非常不利. 有可能以某种方式将其删除.我想这是一些JavaScript,但我不知道是哪一个.

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.

推荐答案

我先前的回答确实有误.

您需要默认关闭静态块所见即所得"编辑器.

转到系统->配置,在左侧找到常规"部分,单击内容管理并设置启用所见即所得编辑器" 从列表中默认情况下禁用" .

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.

然后仔细编辑静态块-使用所见即所得,但事后检查HTML.

Then edit your static blocks carefully - use the WYSIWYG but check your HTML afterwards.

此行为是所见即所得(WYSIWYG)编辑器的标准功能,这就是它们的用途,添加了<p>标记是因为它们可以很好地格式化文本.显然,如果添加仅包含图像的静态块,那么这不是您想要的,因此请退出编辑器并检查<p>标签.

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.

WYSIWYG编辑器还可以处理输入到静态块中的变量,这会减慢管理页面的加载时间,因此最好默认将其关闭.

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.

这篇关于Magento静态块.删除包装&lt; p&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆