Problems adding new template

Problems adding new template

Friday 11 June 2010 12:57:29 am - 8 replies

Modified on Friday 11 June 2010 1:09:40 am by Steven Stieng

Author Message

André R.

Friday 11 June 2010 1:23:05 am

1. You are missing conditions in your override setting, menaing the last one will "overrride" the first one in every case.

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_override_conditions

2. As for the admin error, I guess you added the template in a design only used by front end (for instance ezwebin) but not back end, and then added the override ini setting globally in settings/override or extension/<extension>/settings/, when it should have been placed in settings/siteaccess/<frontend_siteaccess>/ if you inteded to only use it in frontend and not backend(admin).

3. There is a tutorial for creating ezp sites, its a bit old but still relevant (concepts are the same):

http://ez.no/ezpublish/documentation/building_an_ez_publish_site (see links to the right to start tutorial)

Hope this helps,
André

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Steven Stieng

Friday 11 June 2010 1:49:58 am

Thanks for the reply André.

1. That's what I thought.
2. If I remove the last adition to the INI file, admin interface works fine.
3. Yeah, I've looked at this. And it only tells my what I've already done.

To ask in another way:

4. Do I always have to use override when creating new templates?
5. Where do I place new templates?
6. Where is the connection between a new template.tpl file and equivalent class name?

I'm still trying to get my head around ez Publish. But it's extremely difficult. There are so many places where one can put a file - and too many INI files to get an overview.

 And the lack of tutorials / examples. http://ez.no/doc does not prived tutorials or any good examples.

Steven Stieng

Friday 11 June 2010 2:52:39 am

UPDATE

 This is my new override.ini.append.php file:

[page_article]
Source=node/view/full.tpl
MatchFile=page_article.tpl
Subdir=templates
Match['class_identifier']=page_article

[complaint]
Source=node/view/full.tpl
MatchFile=complaint.tpl
Subdir=templates
Match['class_identifier']=complaint

My file is located in: C:\wamp\www\mysite\settings\override

My templates files are located in:
C:\wamp\www\mysite\extension\ezwebin\design\ezwebin\override\templates 

I'm still getting these errors:

Error: eZTemplateDesignResource::overrideArray

Jun 11 2010 11:49:34

 

Custom match file: path 'page_article.tpl' not found in any resource. Check the template settings in settings/override.ini

Error: eZTemplateDesignResource::overrideArray, tried files

Jun 11 2010 11:49:34

 

design/admin2/override/templates/page_article.tpl, extension/ezmultiupload/design/admin/override/templates/page_article.tpl, extension/ezjscore/design/admin/override/templates/page_article.tpl, design/admin/override/templates/page_article.tpl, extension/ezmultiupload/design/standard/override/templates/page_article.tpl, extension/ezjscore/design/standard/override/templates/page_article.tpl, extension/ezwt/design/standard/override/templates/page_article.tpl, extension/ezstarrating/design/standard/override/templates/page_article.tpl, extension/ezgmaplocation/design/standard/override/templates/page_article.tpl, extension/ezoe/design/standard/override/templates/page_article.tpl, extension/ezodf/design/standard/override/templates/page_article.tpl, design/standard/override/templates/page_article.tpl

Error: eZTemplateDesignResource::overrideArray

Jun 11 2010 11:49:34

 

Custom match file: path 'complaint.tpl' not found in any resource. Check the template settings in settings/override.ini

Error: eZTemplateDesignResource::overrideArray, tried files

Jun 11 2010 11:49:34

 

design/admin2/override/templates/complaint.tpl, extension/ezmultiupload/design/admin/override/templates/complaint.tpl, extension/ezjscore/design/admin/override/templates/complaint.tpl, design/admin/override/templates/complaint.tpl, extension/ezmultiupload/design/standard/override/templates/complaint.tpl, extension/ezjscore/design/standard/override/templates/complaint.tpl, extension/ezwt/design/standard/override/templates/complaint.tpl, extension/ezstarrating/design/standard/override/templates/complaint.tpl, extension/ezgmaplocation/design/standard/override/templates/complaint.tpl, extension/ezoe/design/standard/override/templates/complaint.tpl, extension/ezodf/design/standard/override/templates/complaint.tpl, design/standard/override/templates/complaint.tpl

 

It does not help putting the files in /full directory, and changing INI file to MatchFile=full/page_article.tpl.

Steven Stieng

Friday 11 June 2010 3:54:33 am

Someone else having the same problem as well:

http://share.ez.no/forums/general/custom-match-file-path-full-some-.tpl-not-found-in-any-resource.-check-the-template-settings-in-settings-override.ini

André R.

Friday 11 June 2010 5:02:03 am

> 4. Do I always have to use override when creating new templates?

Only when overriding a template using a set of conditions(aka conditional overrides), if you want to create a reusable template stub for use with include in templates, then you can just place it in template folder.

Or if you create your own eZ Publish module, you normally just place the needed files in template folder as well, optimally using a naming convention like this: template/<module>/<view>.tpl.

Example: content module as used for all content in eZ Publish (articles / folders / forums... all content classes), it's system url uses the following form: content/view/<view>/<node_id> where <view> can be anything, but normally 'full' or 'line', if 'full' then the following template is used content/view/full.tpl if you want to have a specific template for this node (or the frontpage class that you would normallt have on this node) then you need to override that template with a conditional template.

> 5. Where do I place new templates?

As said above, direct includes in: templates/ and for override.ini overrides: override/templates/

> 6. Where is the connection between a new template.tpl file and equivalent class name?

the connection between a content class's custom templates and it's templates are always defined in override.ini.

> It does not help putting the files in /full directory, and changing INI file to MatchFile=full/page_article.tpl.

Where do you get this errors? everywhere? admin? or only in specific places in admin like for instance: class/view/<id> with 'override templates' button disabled?
Hint: If only last option, then you can safely ignore it, it's a bug in how the system loads other siteaccesses then it self and tries do look up all overrides without having access to all design folders of those siteaccesses.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Olaf Fichtner

Thursday 13 January 2011 1:45:30 am

> 4. Do I always have to use override when creating new templates?

Only when overriding a template using a set of conditions(aka conditional overrides), if you want to create a reusable template stub for use with include in templates, then you can just place it in template folder.

This is something I never really understood, because everything I found documented was intertwined with several conditions, so maybe I can finally get an answer this time:

Does this mean that I only need to create a new content class like "report", and then create a template with the same name (report.tpl) to have the template used by the system? If so, where would I place such a template? I did a search on "article.tpl" in the installation tree and ended up with 16 hits, all of them with an "override" folder in the path...

Gaetano Giunta

Thursday 13 January 2011 5:32:59 am

Does this mean that I only need to create a new content class like "report", and then create a template with the same name (report.tpl) to have the template used by the system?

No.

If you want to ALWAYS use your own template instead of the given template, you do not need any override condition; eg: always use your own tpl for login page (user/login.tpl), or always use your own template for displaying ezstarrating attributes (content/datatype/view/ezstarrating.tpl)

By default all content is shown using the same template: node/view/full.tpl

So if you want to use a different template for 'only some content', such as a specific content class, you do need an override rule and a template in the override folder

Principal Consultant International Business
Member of the Community Project Board

Olaf Fichtner

Thursday 13 January 2011 6:54:33 am

OK, then I bury that hope. But I would really really like to ask two more questions:

1) I saw different instructions regarding the override.append.ini.php, one said to put it into the design folder, one spoke of the siteaccess folder. Which one is right?

2) Overriding is mentioned pretty often with custom templates, and through debug I can find out which article.tpl is called at what time, but supposed I want to create above mentioned report.tpl, do I put the file into the same folder as a corresponding article.tpl (all of them in some override path already) or do I need to override these overrides - and if, where?

Edit: OK, I finally got it...

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.