This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Allow iframe in WYSIWYG
expandshrink

Allow iframe in WYSIWYG

Allow iframe in WYSIWYG

Friday 07 November 2014 4:54:40 pm - 8 replies

Hi,

I want to allow iframes in my WYSIWYG.

For this, I override the content.ini file like this:

[literal]
AvailableClasses[]
AvailableClasses[]=html

But when I add an iframe, the changes are not saved.

Somene can help me ?

Thanks a lot

Friday 07 November 2014 5:13:27 pm

Hello Tapia,

Sorry your having troubles.

If your having troubles with the literal tag (you should have no problem doing this when done correctly), I would use a custom tag instead.

Re: http://share.ez.no/forums/general/iframe-and-literal-tag

http://share.ez.no/forums/developer/custom-tag-with-iframe

What version of eZ Publish are you using?

Can you share the ezxml text input your trying to save so we know your markup contains no problems?

Cheers,
Heath 

Modified on Friday 07 November 2014 5:19:54 pm by // Heath

Monday 10 November 2014 4:11:54 pm

Hi,

I'm using ezpublish 2014.07 version.

I try to insert this iframe code:

 <iframe width="560" height="315" src="//www.youtube.com/embed/cVgWHy5qzxQ" frameborder="0" allowfullscreen></iframe>

Even if I try this, it doesn't work:

<literal class="html">
          <iframe width="560" height="315" src="//www.youtube.com/embed/cVgWHy5qzxQ" frameborder="0" allowfullscreen></iframe>
</literal>

 

When I'm editing a wysiwyg bloc, all iframe values are unsaved.

Example:

I write this:

 <p>hello</p>
<iframe width="560" height="315" src="//www.youtube.com/embed/cVgWHy5qzxQ" frameborder="0" allowfullscreen></iframe>
<p>end</p>

And here what's saved:

 <p>hello</p>
<p>end</p>

suspicious.gif Emoticon

Monday 10 November 2014 5:47:12 pm

Hello Tapia,

Remember that you can't just insert iframe html.

Your iframe html must -always- be wrapped in literal tags (as you show in your second example).

It sure seems like your ini settings changes to enable the literal tag's html class is not being enabled / activated properly.

Can you share the full file path to the setting file where you have added this content.ini setting.

Cheers,
Heath 

Wednesday 12 November 2014 9:23:10 am

Hi Tapia

For what you're trying to do, you should use EmbedTagBundle, or if you just use legacy, jvEmbedTag legacy extension.

Wednesday 12 November 2014 12:05:31 pm

Hi,

The full path is:

 /var/www/website/ezpublish_legacy/settings/override/content.ini.append.php

And here the start of the file:

 <?php /* #?ini charset="utf-8"?
 
[CustomTagSettings]
AvailableCustomTags[]=underline
IsInline[underline]=true
AvailableCustomTags[]=iframe
IsInline[iframe]=false
 
[literal]
AvailableClasses[]
AvailableClasses[]=html
 
 
[iframe]
CustomAttributes[]=src
CustomAttributes[]=width
CustomAttributes[]=height
 
[table]
...

 

 

I add a CustomTag iframe, it's work's on backoffice but, in the frontoffice, the code never appears.

I'm working on it.

Wednesday 12 November 2014 12:18:43 pm

You say you're using 2014.07. Please note that html class support for literal was added some weeks ago, in September. https://github.com/ezsystems/ezpublish-kernel/pull/954

So you can update to 2014.11 and literal class html should work. 

On the other hand, custom tag like iframe should work also in 2014.07, but remember you need a custom template (xslt) for it . Something like this.

Wednesday 12 November 2014 12:24:43 pm

Hello Tapia,

After hearing a lot more suggestions I think it's time for you to answer definitively this question:

Are you using the symfony frontend stack or legacy front end stack?

 

Cheers,
Heath 

Wednesday 12 November 2014 12:29:47 pm

Hi,

I'm using the symfony frontend stack.

 

I resolve my problem using a custom tag (https://doc.ez.no/display/EZP/How+to+implement+a+Custom+Tag+for+XMLText+FieldType)

 

Thanks a lot for your time !

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from