Forums / General / Embed Image Template override

Embed Image Template override

Author Message

John Smith

Friday 11 April 2008 4:13:13 am

Hi there,

Hope someone can help me.

In ez4.0 i am trying to override a template named as "image_embed_node", the location of this template is:

Adminstration -> Design -> Templates -> /node/view/embed.tpl

Has anybody got clue how to do it.

I have created another template under /node/view/embed.tpl with the same class identifier and changed the priority to 1. But i am still getting the code from the "image_embed_node"....

In the override file I got the following:

[sl_embed_image]
Source=node/view/embed.tpl
MatchFile=sl_embed_image.tpl
Subdir=templates
Match[class_identifier]=image

[image_embed_node]
Source=node/view/embed.tpl
MatchFile=embed/image.tpl
Subdir=templates
Match[class_identifier]=image

John Smith

Friday 11 April 2008 7:41:32 am

Anybody please????

Jon Staines

Friday 11 April 2008 9:20:19 am

Does debug show that it is still using embed/image.tpl if you list the templates used?

Which extension if any did you save sl_embed_image.tpl under? I assume this is for the admin site as I've never seen /node/view/embed.tpl outside of that.

John Smith

Saturday 12 April 2008 5:48:42 am

Hi Jon,

Thanks for your kind reply. I have checked the list of templates but it not displaying the template which I have created.

In the list I am getting.

Usage Count 1
Requested template: content/view/embed.tpl
Template: embed/image.tpl
Template loaded: design/base/override/templates/embed/image.tpl

You will get this sort of result if you create the article and add an image with Add Object" button.

Displaying the article from the public site will give all the results mentioned above.

Anybody from ezcrew???

Jon Staines

Monday 14 April 2008 12:58:48 am

I think I see whats happening. The template list says its using content/view/embed.tpl but you've added the override to node/view/embed.tpl.

If you have access to edit the override.ini.append.php file by hand just change that entry. If not then use the interface to remove the one you've made and make a new override for content/view/embed.tpl.

See if that does the trick.

John Smith

Monday 14 April 2008 1:56:57 am

Hi Jon,

Thanks for your kind clue. What I did I clicked on the content/view/embed.tpl/ which gave me the big list of the templates and then created an override template that with the upper priority.

It is working fine now. Thanks for your kind help.

One more thing. I am trying to do the same thing for the

content/datatype/view/ezxmltags/quote.tpl

but it not working in either ways.

Is there anything simple in ezpublish 4.0. I have used 3.6 in which i used to create another template in

design/<siteaccess>/templates/datatype/ezxmltext/quote.tpl

to override the template in

design/base/override/templates/datatype/ezxmltext/quote.tpl

Any clue on this one please.....

I dont want to edit the base templates, just overrides only...

Jon Staines

Monday 14 April 2008 2:09:34 am

In 4.0 I believe you have to use an override for any changes, you can no longer just have the template in a similar path in a design extension (don't hold me to that as I haven't tried).

What entry do you have in override.ini.append.php for the quote? I'll have a look on a copy here and see if it works when I try.

John Smith

Monday 14 April 2008 2:14:33 am

Override ini

This is the custom one which I created....

[sl_quote]
Source=content/datatype/view/ezxmltags/quote.tpl
MatchFile=sl_quote.tpl
Subdir=templates

This is the already there by default...

[quote]
Source=content/datatype/view/ezxmltags/quote.tpl
MatchFile=datatype/ezxmltext/quote.tpl
Subdir=templates

Jon Staines

Monday 14 April 2008 2:22:21 am

I get the same problem, for some reason the priorities seem to work the other way around for this template. The later entry in the file takes preference. You could issue a bug or see if any of the eZ Crew can explain why it works this way around.

To use it, either make your override a lower priority or as your override would just replace the existing ezwebin override you could just edit that template (extension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tpl).

John Smith

Monday 14 April 2008 2:38:28 am

It worked.

I am not using ezwebin interface, just using plain_site.

So this seems bug....

EzCrew Pease Confirm.

Cheers.

John Smith

Tuesday 15 April 2008 12:47:30 am

Any body from EzCrew please???