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

eZ Community » Forums » eZ Publish 5 Platform » How to override an embed template?
expandshrink

How to override an embed template?

How to override an embed template?

Friday 14 June 2013 10:13:50 am - 14 replies

Hi,

I want to override the template for an object embedded in a xml-block. How do I do this in ez publish 5?

When I embed an object now all I get is a link to the node. I want the content presented directly in the page so I want to override the template just as I used to do in ez publish 4.x. I think the template loaded is a legacy one and if it is I have no idea how to override those.

Saturday 15 June 2013 11:45:33 am

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

Monday 08 July 2013 2:26:58 pm

Hi,

Try to override the block you need in this twig : YourBundle/Resources/views/fields/content_fields.html.twig

Tuesday 09 July 2013 12:02:19 pm

Thanks for replying! But I want to override an embed template not the xml-block. I don't see a way to do that with that file or am I wrong?

Tuesday 09 July 2013 6:14:49 pm

Hi,

i'd love to know too ... 

Wednesday 10 July 2013 9:49:59 am

Have you checked this: http://share.ez.no/forums/ez-publish-5-platform/disable-xml-information-in-output?

Modified on Wednesday 10 July 2013 9:51:17 am by Nicolas Lescure

Wednesday 10 July 2013 10:48:10 am

Hi all

All embedded objects (including from XML blocks and Relation(s)) use ez_content:viewContent. Thus, you can set your template selection rules in ezpublish.yml, using content_view instead of location_view.

Doc: https://confluence.ez.no/display/EZP/View+provider+configuration

Modified on Wednesday 10 July 2013 10:57:20 am by Jérôme Vieilledent

Wednesday 10 July 2013 5:09:54 pm

Thanks Jérôme!

I can't try it now but that looks like the answer to my question.

Wednesday 10 July 2013 7:58:57 pm

I notice that the eZXml2Html5_core.xsl add some html tags in a XML Block , is there a good practice to override this one ?

Monday 15 July 2013 3:56:39 pm

I got a related question ti this subject : 

i added a html class on an li element (i registered it as usual in the content.ini.append.php in the admin siteaccess) , i can select it ...but it doesn't show up in the frontend ... should i update the eZXml2Html5_custom.xsl ? 

Tuesday 16 July 2013 10:23:44 am

Hi Joël

Registering in legacy content.ini.append.php is not sufficient. You indeed need to extend the base XSL stylesheet.

See:

You also may want to have a look at this blog post happy.gif Emoticon

Cheers !

Monday 12 August 2013 1:07:56 pm

VERY NICE;;;;;;;;;;;;;

Monday 19 August 2013 9:57:49 am

@Joël : As of 2013.07, you can easily create and override custom tags. See cookbook recipe on Confluence.

Thursday 12 September 2013 11:15:40 pm

Be careful, it doesn't work until/including 2013.7. There is a pull request on github fixing the problem: https://github.com/ezsystems/ezpublish-kernel/pull/505

In between you can fix the bug manually in file eZ/Bundle/EzPublishCoreBundle/Resources/config/templating.yml at line 43 replace 
"@ezpublish.location_view.matcher_factory" with "@ezpublish.content_view.matcher_factory"

Result should look like:

    ezpublish.content_view_provider.configured:        class: %ezpublish.content_view_provider.configured.class%        arguments: [@ezpublish.content_view.matcher_factory]        tags:            - {name: ezpublish.content_view_provider, priority: 10}

then you can use "content_view" in override.yml

Modified on Thursday 12 September 2013 11:18:21 pm by Marco Stipek

Friday 13 September 2013 10:51:29 am

Thanks Marco, as mentioned in the PR, please report an issue on Jira and link it to your PR. Thanks happy.gif Emoticon

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from