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 » How to override content classes

How to override content classes

How to override content classes

Wednesday 10 April 2013 1:06:45 am - 7 replies

I have created a bundle with:

php ezpublish/console generate:bundle

In ./src/Cme/MiBundle/Resources/config/ezpublish.yml I have write:

    - { resource: override.yml } 

And in ./src/Cme/MiBundle/Resources/config/override.yml I have write this:

                        template: MiBundle:full:miclass.html.twig
                            Identifier\ContentType: miclass

And I have created a view in ./src/Cme/MiBundle/Resources/views/full/miclass.html.twig

But It doesn't work sad.gif Emoticon

What's wrong?

Modified on Wednesday 10 April 2013 1:19:50 am by Israel Martín

Wednesday 10 April 2013 8:50:30 am


Do you have any error message ? Which version of eZ Publish do you use ? 

Try to replace 

template: MiBundle:full:miclass.html.twig
template: CmeMiBundle:full:miclass.html.twig


Modified on Wednesday 10 April 2013 8:51:14 am by Philippe Vincent-Royol

Wednesday 10 April 2013 10:11:11 am

Philippe, thanks for answering.

I tried it too but it doesn't work neither (I did so because I see it in this post about

I think that the eZ doesn't read the ./src/Cme/MiBundle/Resources/config/override.yml file because eZ Publish doesn't throw errors nor warnings.

The version of eZ Publish is 1.2013

Modified on Wednesday 10 April 2013 10:17:14 am by Israel Martín

Wednesday 10 April 2013 8:24:15 pm

Yeah but becarful Damien used a "shortcut" for PlanetBundle (Its defined on 


So if you don't do this you should use

 template: CmeMiBundle:full:miclass.html.twig

Could you check on SF toolbar, that you're correctly running ViewController::viewLocation and not using some fieldtype like ezpage ?


Wednesday 10 April 2013 8:49:13 pm

I have test it and you are right, Philippe, the "Cme" is mandatory at the beginning.

Carlos Revillo helped me on GTalk and I have a "solution", in ./ezpublish/config/config.yml I added this:

- { resource: @CmeMiBundle/Resources/config/override.yml }

On the "imports" block.
Then, I can write my override rules on mi bundle ./src/Cme/MiBundle/Resources/config/override.yml

I tried to add this on ./src/Cme/MiBundle/Resources/config/config.yml and on ./src/Cme/MiBundle/Resources/config/ezpublish.yml (like on ezpublishplanet) and It doesn't work. 

Anybody know how to make that eZP read config files of the bundles?

Thanks for your help Philippe and C. Revillo and sorry for my english.

Modified on Wednesday 10 April 2013 8:51:11 pm by Israel Martín

Wednesday 10 April 2013 9:00:38 pm


Symfony requires manual adding of config files via the DependencyInjection system. However, you will not be able to specify the "ezpublish" extension setting via a bundle. A system error will be thrown.

I have currently create a bundle that will allow you to prepend configuration settings based on

Wednesday 10 April 2013 9:03:20 pm

Ahhh you was on your bundle .. sorry i didnt read correctly happy.gif Emoticon=

So if you would like to run configuration via a bundle you should used something like that on your services.yml or whatever other yml file (of course you need to add it on you bundle configuration to say to SF: hey boy you have to read my new yml file happy.gif Emoticon )


                template:  CmeMiBundle:full:miclass.html.twig
                    Identifier\ContentType: miclass 

If you have time, you could add this tip to eZ 5 cheatsheet:

Or i will do it later


Modified on Wednesday 10 April 2013 9:05:11 pm by Philippe Vincent-Royol

Thursday 11 April 2013 11:02:15 am

I didn't knew the cheatsheet, It looks great.

I'm going to mark this post like "solved".

Thanks for yout help!.


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

36 542 Users on board!

Forums menu

Proudly Developed with from