2

I've added the "html"-button to TinyMCE on an EZ Publish site so that the users can write custom html into the xmlblock-field. But html-code with div-, img- and other tags get stripped when the user saves. If I use the ''-tag I assume that the html-code inside will be rendered as viewable html-code on the web page, instead of actual html-content.

How can I enable html-editing in the ezoe?

This is what I'm trying:

  1. Click the html-button in TinyMCE.
  2. Write html-code:

    <div style="text-align:left; width:496px; margin-left:auto; margin-right:auto;"> <img id="Image-Maps_fottoey" src="some url.jpg" width="496" height="249" alt="" /> </div>

  3. Click "Publish". When viewing the page it has no trace of the html-code from step 2.

I've tried to add the following to my override content.ini.append.php:

[literal]
AvailableClasses[]
AvailableClasses[]=html

as per http://acidre.com/blog/ez-publish-saisir-du-contenu-directement-en-html/ but that doesn't help.

Update: It works now with the changes that I made to content.ini.append.php. This change adds "html" as a literal option and gives you a new icon in the editor, which Nicolas pointed me to (looks like a sheet of paper and is on icon row 2, first section before the Omega-icon.

When you add the html-source in the purple edit field, the editor will create links if it discovers that you've pasted inn urls. These links are blue in the editor. You must break these links with the "Break link"-icon to the far right on icon row 1. There should be no blue hyperlinks in the editor when you save. If you've managed this, the published page should display your custom html nicely :)

Henrik
  • 23
  • 1
  • 4

1 Answers1

2

The usual way of enabling literal HTML in eZ Online Editor (based on TinyMCE) in eZ Publish is to uncomment the

AvailableClasses[]=html

configuration directive in an override of content.ini. A bit more of information here : http://share.ez.no/forums/setup-design/custom-tag-stop-while-running/comment64177.

Then, the literal tag should be available to editors through the literal button in TinyMCE (this button looks like a text sheet). The dropdown proposed in the pop-up menu shows 'html'.

Allowing raw html requires a few editorial guidelines and full trust in editors, but i am sure you are aware of this.

Cheers,

Nicolas

Nicolas
  • 253
  • 1
  • 7
  • Thanks, the "literal"-button (the one that looks like a text sheet) was news to me. Now I'm abit closer.. when I add a new literal tag and choose the class "html" I get this purple area for the html-code. But when I saw the html-code i garbled abit and has a ''-tag with id='BugEvents'. – Henrik Aug 26 '11 at 11:54
  • Actually it would work now had it not been for ezoe resolving the hyperlinks in the html-code. When I paste in html-code the src="" that has an url in it gets turned into an ''-tag, and this escapes all my html-code. Is there a way to make ezoe not interpret urls into ''-tags? – Henrik Aug 26 '11 at 12:07
  • Hi, i tested locally on a fresh installation of the latest [eZ Publish Community Project](http://share.ez.no/latest) version and the issue i had when pasting such a snippet as [this one](http://web.mac.com/ijasonwhite/iwebunlimited/HTML_Snippets.html) was that '' tags were added for every new line, breaking the final rendering. My workaround has been to paste the HTML first in a simple text editor (TextEdit on mac), copy it again and paste it in eZOE. Worth trying this ? – Nicolas Aug 26 '11 at 12:46