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

eZ Community » Forums » eZ Publish 5 Platform » RichText - Title/header level

RichText - Title/header level

RichText - Title/header level

Monday 17 August 2015 10:31:18 am - 2 replies

Hi all,

Some of my nodes are contributed with Rich Text Editor by eZoe.
When I select header level ("Titre 1", "Titre 2", "Titre 3", ...) in the editor and publish my content, it displayed with level +1.

For example, if I choose "Titre 1" in order to have

 <h1>my title level 1</h1>

, I have

 <h2>my title level 1</h2>


How is it possible to have displayed the level title that I choose ?

I have searched some solutions and I think there is something to do by overriding eZXml2Html5_core.xsl but I am not sure and I don't know how.

Modified on Monday 17 August 2015 10:32:52 am by Nicolas Cordonnier

Monday 17 August 2015 5:33:32 pm

This file (YourBundle/Resources/fieldtypes/header.xsl) seems to make the job :

<?xml version="1.0" encoding="UTF-8"?>
        exclude-result-prefixes="xhtml custom image">
    <xslomg.gif Emoticonutput method="html" indent="yes" encoding="UTF-8"/>
    <xsl:template match="header">
        <xsl:variable name="level" select="count(ancestor-or-self::section)-1"/>
        <xsl:variable name="name">
            <xsl:number count="section" level="multiple"/>
        <xsl:element name="h{$level}">
            <xsl:copy-of select="@class"/>
            <xsl:copy-of select="@align"/>

Modified on Monday 17 August 2015 5:48:00 pm by Nicolas Cordonnier

Monday 17 August 2015 6:24:08 pm

Hi Nicolas,

this is actually intentional as documents with several h1 tags would be invalid markup in the past, and h1 is usually already on the page provided by name of the object. But for next version we can consider skipping this as html5 is more relaxed on this anyway, especially combined with use of section tags, which we can consider reflecting from our internal format.

But you can indeed override it in similar way you did happy.gif Emoticon

Modified on Monday 17 August 2015 6:24:39 pm by André R


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

36 542 Users on board!

Forums menu

Proudly Developed with from