eZ Community » Forums » eZ Publish 5 Platform » Wysiwyg literal tag not working?
expandshrink

Wysiwyg literal tag not working?

Wysiwyg literal tag not working?

Tuesday 10 December 2013 11:09:07 am - 8 replies

Hello,

Did someone manage to use literal tag in a content object in ez5? To display an embed video for example?

Thanks!

Tuesday 10 December 2013 2:45:47 pm

Hi Irma,

Literal blocks are working well for me in eZ Publish 5 even with legacy_mode disabled.

Did you mean custom_tags ?

Tuesday 10 December 2013 3:50:04 pm

Hi,

Thanks for your reply ; I'm talking about literal blocks, not custom_tags, so it must come from me. I just wanted to know if there were a known issue or not. 

Thanks again!

Tuesday 10 December 2013 5:30:14 pm

Hummm... sorry but I am still struggling with this :

I have a contact page using legacy in which my literal blocks shows well my video. It works fine as well in the admin site access, after publishing my object.

But I can't manage to make the video appear on the "ez5" front page. This is the code which is displayed (beginning with "pre class="html" when looking at the source code)

What am I missing? Is there a parameter (like [literal]AvailableClasses[]=html in content.ini.append.php) to add?

Thanks for your help!

 

Wednesday 11 December 2013 12:00:06 pm

Sorry, I misunderstood your need.

In my case, only a block <pre> is displayed, with the chosen css class.

I guess it's because, in the ez5 front, the twig template which renders ezxmltext fields doesn't behave as the legacy one. It doesn't interpret the literal block content even with the class 'html'.

I guess you could override this template and apply a custom twig filter on the field, to remove <pre> tags around its content. Here some documentation about overriding: https://confluence.ez.no/display/EZP/ez_render_field.

Hope it can help

Wednesday 11 December 2013 12:56:22 pm

It does help, thanks a lot.

 

Bye,

Irma

Modified on Wednesday 11 December 2013 7:07:54 pm by Irma Vrignaud

Friday 16 May 2014 3:56:49 pm

Hello!

When I add the literal tag with or not html class, on front-end a pre tag is inserted. When I remove the pre tag from file eZXml2Html5_core.xsl and section <xsl:template match="literal"> it doesn't work because the characters are encoded as entities!

Is there any way to not transform in entities, so the browser parse correctly the HTML? How can I override it with a custom twig template?

Thanks

Friday 16 May 2014 4:27:31 pm

Have you added something like this to your own custom tag XSL file?

https://twitter.com/mugo/status/433847186216849409

Friday 16 May 2014 5:37:08 pm

Thank you very much! It works like a charm!

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from