New template

Author Message

David Santiso

Thursday 30 December 2010 5:02:16 am

Hi,

I copied a default class to modify my way while preserving the original, but this newclass uses a default template.

How do I create a new template for my class? In which directory do I have to create and what name? What I have to modify configuration files?
Thanks,
David

Edi Modrić

Friday 31 December 2010 9:25:07 am

Hi David,

you need to put your template in mydesign/override/templates/full/ folder. Best practice is that you tpl file name matches your class identifier. So if your new class identifier is my_class, the full path to the new tpl file should be mydesign/override/templates/full/my_class.tpl

After that, you need to add the following in settings/my_siteaccess/override.ini.append.php and clear ini & override caches. (full details at: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/override.ini)

[full_my_class]
Source=node/view/full.tpl
MatchFile=full/my_class.tpl
Subdir=templates
Match[class_identifier]=my_class

eZ Publish certified developer

http://ez.no/certification/verify/350658

David Santiso

Saturday 01 January 2011 11:17:23 am

Thank you.

I copied the template in "extension\ezwebin\design\ezwebin\override\templates\full\copy.tpl". The name of the template is the same as the class.

I added the new lines in the file "settings\siteaccess\[my_syte]\override.ini.append.php", but still shows the default template.

Edi Modrić

Saturday 01 January 2011 2:21:55 pm

Hi David,

this setup should work without problems. You can check couple of things:

1) Did you clear your caches? Maybe purge var/cache and var/ezwebin_site/cache folders directly from the disk?

2) Does your siteaccess use ezwebin as the main or additional design?

3) Are the new settings in override.ini.append.php correct? Doublecheck them.

eZ Publish certified developer

http://ez.no/certification/verify/350658

David Santiso

Sunday 02 January 2011 6:40:06 am

I put this in "override.ini.append.php ":

[full_copy_of_feedback_form]
Source=node/view/full.tpl
MatchFile=copy_of_feedback_form.tpl
Subdir=templates
Match[class_identifier]=copy_of_feedback_form

The name of new class is "copy_of_feedback_form".

How I can clear the cache directly from the disk?

How do I know siteaccess use ezbin as main or additional design?

Thanks,

David

Edi Modrić

Sunday 02 January 2011 7:08:31 am

Hi David,

you have an error in your override rule. Third line "MatchFile=copy_of_feedback_form.tpl" should be "MatchFile=full/copy_of_feedback_form.tpl"

Change that, and clear the caches from administration.

To answer your other questions (but I suppose they are not necessary since override.ini is cause of your problem)

1) You can clear the cache from disk by first positioning yourself in your ez publish install directory and then running the following (take care while running the commands, if not careful, rm can be destructive, do backup your site please!)

rm -rf var/cache

rm -rf var/ezwebin_site/cache

2) You can verify that your siteaccess is using ezwebin design by checking the following in site.ini

[DesignSettings] AdditionalSiteDesignList - ezwebin should be listed in this array

or
[DesignSettings] SiteDesign - ezwebin should be the value of this configuration

eZ Publish certified developer

http://ez.no/certification/verify/350658

David Santiso

Sunday 02 January 2011 9:32:43 am

I do not believe me, but I've changed and still does not work.

I have activated "Template debug". It's looking for the template in "node/view/full.tpl" and "extension/ezbin/design/ezbin/templates/node/view/full.tpl", but my template is in "extension/ezbin/design/ezbin/override/templates/full/copy_of_feedback_form.tpl".

I don't understand :S

My AdditionalSiteDesignList[] array is empty and...

StandarDesign = standard and...

SiteDesign = admin

Carlos Revillo

Monday 03 January 2011 2:35:00 am

hi David.

could you please paste here the entire DesignSettings group in your settings/siteaccess/[mysite]/site.ini.append.php file?

There's one thing i can't understand well. You say you have SiteDesign=admin but you seem to be working with a custom design (mysite), right? It's strange to have SiteDesign=admin in a custom design...

David Santiso

Monday 03 January 2011 11:21:19 am

Ok.

[my_site] as I called my site (the front-end), but should use the default layout, because I have not changed anything.

My DesignSettings group in "settings/siteaccess/[my_site]/site.ini.append.php is:

[DesignSettings]
SiteDesign=ezflow
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

SiteDesign=admin was in "settings/site.ini"

Edi Modrić

Monday 03 January 2011 3:02:54 pm

Hi David,

by mentioning site.ini, I was referring to settings/siteaccess/[my_site]/site.ini.append.php, maybe I should've been more clear, sorry about that :)

Now, I see nothing wrong in your [DesignSettings] configuration in site.ini.append.php
Also, the rule you placed in settings/siteaccess/[my_site]/override.ini.append.php is fine now you corrected it.
The template is placed fine.

I can't think of any reason why it doesn't work, as long as ezwebin extension is activated and caches are cleared, it should :(

eZ Publish certified developer

http://ez.no/certification/verify/350658

Carlos Revillo

Monday 03 January 2011 11:18:50 pm

I second Edi here. You're following the right stepts. Can't find any reason why it is not working...

David Santiso

Thursday 06 January 2011 7:44:43 am

Thanks also for all the help ;)
Try it again, for sure I am overlooking something.

David Santiso

Thursday 06 January 2011 9:23:47 am

I've been looking at other classes in the back-end.

For example, in the editing screen of the class "Feedback form ", is this:

Acceso al sitio Sobreescribir Plantilla fuente Sobreescribir plantilla  
my_site line_feedback_form /node/view/line.tpl    
esl full_feedback_form /node/view/full.tpl    
esl line_feedback_form /node/view/line.tpl    
my_site_admin feedback_form /node/view/admin_preview.tpl design/admin2/override/templates/admin_preview/feedback_form.tpl  

In my class get this:

Acceso al sitio Sobreescribir Plantilla fuente Sobreescribir plantilla  
my_site full_copy_of_feedback_form /node/view/full.tpl    

Edi Modrić

Thursday 06 January 2011 10:55:57 am

Hi David

from this data, it seems that your override rule is being recognized, it is mentioned in the list, under "Sobreescribir", which I presume means "override", however "Sobreescribir plantilla" (override template) is empty, which suggests that either:

1) Your template file name is wrong or somehow at wrong location or can't be read

  • The issue might also be if you created the new file with root priviledges, for example, and eZ Publish simply cannot read it due to lack of permissions

2) Your class identifier, "copy_of_feedback_form" is misspelled

3) "MatchFile=copy_of_feedback_form.tpl" or "Match[class_identifier]=copy_of_feedback_form" lines in your override rules are misspelled.

Good luck in finding the issue!

eZ Publish certified developer

http://ez.no/certification/verify/350658

David Santiso

Thursday 06 January 2011 11:59:57 am

Thanks, I'll keep searching.
But what I find strange is that the class "Feedback form" the "template override" is also empty, except for the administration site.

David Santiso

Thursday 06 January 2011 1:55:15 pm

I don't understand why, but I activated the "eZ Debug - List of used templates".

I pushed the override button of the default template and i added the requested data of the new template and now it works :S

Edi Modrić

Thursday 06 January 2011 3:17:54 pm

"

I don't understand why, but I activated the "eZ Debug - List of used templates".

I pushed the override button of the default template and i added the requested data of the new template and now it works :S

"

Glad to hear you solved it.

This one was a weird one, I'll say!

eZ Publish certified developer

http://ez.no/certification/verify/350658

David Santiso

Thursday 06 January 2011 3:29:45 pm

It seems that the new configuration lines are added in the "extension/ezflow" directory and I added in "extension / ezwebin".

Thanks for your help ;)

David Santiso

Sunday 09 January 2011 9:05:48 am

Do you know how I can make the content that users added in the form displayed on the homepage?

Thanks,

David

Edi Modrić

Monday 10 January 2011 6:25:04 am

Hi David,

you can use standard template fetch functions to fetch collection results and display them on any page.

Take a look at the following fetches:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/collected_info_collection

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/collected_info_count_list

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/collected_info_count

eZ Publish certified developer

http://ez.no/certification/verify/350658

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

eZ debug

Timing: Jan 18 2025 05:00:55
Script start
Timing: Jan 18 2025 05:00:55
Module start 'layout'
Timing: Jan 18 2025 05:00:55
Module start 'content'
Warning: PHP: E_DEPRECATED Jan 18 2025 05:00:56
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-02cf899a6d707917c58210ed54ffe2ff.php on line 147
Warning: PHP: E_DEPRECATED Jan 18 2025 05:00:56
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-02cf899a6d707917c58210ed54ffe2ff.php on line 147
Warning: PHP: E_DEPRECATED Jan 18 2025 05:00:56
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-02cf899a6d707917c58210ed54ffe2ff.php on line 147
Timing: Jan 18 2025 05:00:56
Module end 'content'
Timing: Jan 18 2025 05:00:56
Script end

Main resources:

Total runtime1.3011 sec
Peak memory usage4,096.0000 KB
Database Queries129

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.9063152.6094
Module start 'layout' 0.00600.0034 741.515639.4063
Module start 'content' 0.00941.2905 780.9219800.2031
Module end 'content' 1.29990.0012 1,581.125040.4141
Script end 1.3011  1,621.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2541160.0002
Check MTime0.00140.1086160.0001
Mysql Total
Database connection0.00080.064910.0008
Mysqli_queries1.140487.65101290.0088
Looping result0.00110.08491270.0000
Template Total1.263497.120.6317
Template load0.00230.176820.0012
Template processing1.261196.923120.6305
Template load and register function0.00030.019710.0003
states
state_id_array0.00180.140210.0018
state_identifier_array0.00090.068820.0004
Override
Cache load0.00270.21011680.0000
Sytem overhead
Fetch class attribute can translate value0.00060.046030.0002
Fetch class attribute name0.00160.1227210.0001
XML
Image XML parsing0.00070.055630.0002
class_abstraction
Instantiating content class attribute0.00010.0048270.0000
General
dbfile0.00180.1395160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
20content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
28content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/th.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/th.tplEdit templateOverride template
7content/datatype/view/ezxmltags/tr.tpl<No override>extension/community/design/community/templates/content/datatype/view/ezxmltags/tr.tplEdit templateOverride template
10content/datatype/view/ezxmltags/td.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/td.tplEdit templateOverride template
5content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
3content/datatype/view/ezxmltags/table.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/table.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 95
 Number of unique templates used: 15

Time used to render debug report: 0.0001 secs