Wysiwyg in pimcore object?

拥有回忆 提交于 2019-12-25 09:04:31

问题


I have problem with wysiwyg editor in pimcore object. When I mark text, go to Styles and choose for example "Marker" that results nothing. In source code that looks like < span class="marker" > Lorem ipsum < /span >, but in editor it's same. It only gets text, althought text should be yellow.

Any ideas ?


回答1:


The Styles dropdown actually just changes the HTML markup. So this

<p>Lorem ipsum</p>

is changed into

<p><span class="marker">Lorem ipsum</span></p>

If you really want to have yellow text, then you need to add something like this to your frontend css:

.marker {
     background-color: yellow;
}

There is a Source button (last one in the WYSIWYG field toolbar) that let's you examine what markup is actually being produced, so you can build the needed CSS classes.

On the other hand the objects WYSIWYG doesn't know anything about your frontend CSS. The contentsCSS CKEditor option doesn't seem to work, so the fastest workaround would be to create a new Pimcore extension and put into its CSS file something like this:

.pimcore_tag_wysiwyg .marker {
    background-color: yellow;
}



回答2:


I have all classes in frontent css. It works in $this->wysiwyg('content'), but in editing objects attribute wysiwyg don't. It looks good in frontend (I see yellow word), but in backend I dont see the yellow word.



来源:https://stackoverflow.com/questions/39390662/wysiwyg-in-pimcore-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!