eZ Community » Forums » Setup & design » How to override default views of...
expandshrink

How to override default views of content fields

How to override default views of content fields

Thursday 14 March 2013 3:07:50 pm - 3 replies

Please, someone can give me a clue on how to override default views of content fields y ezPublish5?

Thanks

Saturday 12 October 2013 10:01:51 am

HI,

create a template of the content_fields.html.twig

{% extends "eZCoreBundle::content_fields.html.twig" %}

and extend the block you want.

 

Activate this override in ezpublish.yml

ezpublish:
    system:
        mySiteaccess:
            field_templates:
                 - { template: MyBundle:fields:content_fields.html.twig, priority: 0}

 

Greetings!

Frank

Wednesday 19 February 2014 12:44:25 am

Quote from Frank Möller :

HI,

create a template of the content_fields.html.twig

{% extends "eZCoreBundle::content_fields.html.twig" %}

and extend the block you want.

 

Activate this override in ezpublish.yml

ezpublish:
    system:
        mySiteaccess:
            field_templates:
                 - { template: MyBundle:fields:content_fields.html.twig, priority: 0}

 

Greetings!

Frank

https://confluence.ez.no/display/EZP52/ez_render_field

This doesn't work.

tried this one also

http://share.ez.no/index.php/forums/ez-publish-5-platform/printing-raw-field-data-in-a-twig-template

but no luck sad.gif Emoticon.

The only way to make it work is:

{{ ez_render_field( content, 'title', { "template": "MyBundle:fields:content_fields.html.twig" } ) }}

every time you want to render a field with a different template.

Tested on eZ Publish 5.2

Ernesto

Modified on Wednesday 19 February 2014 5:49:45 pm by Ernesto Buenrostro

Monday 10 March 2014 4:34:40 pm

The reply has been removed because of violation of forum rules.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from