This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal
Monday 23 September 2013 12:45:11 pm - 6 replies
Hi
Can someone help me to render a paragraph class from an XML block in a twig template?
So if in the XML block I have:
<paragraph class="main_intro"> … </paragraph>
then the output from the ez_render_field twig template should be:
<p class="main intro"> … </p>
Presently I can only get it to output:
<p> … </p>
My content.ini.append.php: https://gist.github.com/markblackmore/6667797
My XML block content as data_text: https://gist.github.com/markblackmore/6668416
My template that calls my ez_render_field override template: https://gist.github.com/markblackmore/6667830
My ez_render_field override template: https://gist.github.com/markblackmore/6668672
Many thanks
Mark
Modified on Monday 23 September 2013 12:45:53 pm by Mark Blackmore
Monday 23 September 2013 1:24:30 pm
Hello Mark
This is not supported out of the box, but you can easily override the XSL stylesheet to add your custom behavior (like we used to do when overriding ezxml tags in legacy).
Please refer to custom tags documentation to know how to proceed (requires 2013.07 / 5.2).
Tuesday 24 September 2013 9:17:18 am
Hi,
isn't it a missing feature, should it only be for BC ? Legacy eZOE used in admin interface can indeed be configured to allow css classes on paragraphs and other tags, custom or not. If they're not rendered properly in the front, it means that we always have to update manually the XSL stylesheets each time we want to upgrade a website to the symfony stack...
My colleague opened a pull request about this several months ago (https://github.com/ezsystems/ezpublish-kernel/pull/317) and though it has been polluted with formatting issues, I feel like it has not been fully discussed. Maybe now's the time
Wednesday 25 September 2013 10:01:36 am
Thanks Jérôme, Mathieu is remaking his PR right now.
By the way, could you take another look at PR #488 (https://github.com/ezsystems/ezpublish-kernel/pull/488), also about XmlText rendering BC breaks. It is currently stuck due to markup philosophy questioning which IMHO could be resolved by a later update...
You must be logged in to post messages in this topic!