Section template override

Author Message

Mihai007 Pop

Wednesday 16 April 2008 8:14:50 am

Hi guys!

I am having a bit of a problem! I am sure it used to work this way! I have downloaded and installed a fresh new ez4.0.0

Now I create a section called Products and assigned to the frontpage called products! Everything underneath it is now part of this section.

Now I created a new node/view/full template and assigned it to class identifier "folder" and then section "products"! all using the admin interface. I also checked to see if it is under the correct site settings and it is. I also checked to see if i am browsing to the right site and not to eng for example.

When I now look at a folder under the frontpage called products, it still uses the full_folder.tpl. I checked it because I modified it a bit to see if it does and it does.

Now I cleared all caches, i even moved priorities, and I just down't know what else to do...! I need to apply a template to folders under a certain section. Am i doing something wrong or am I missing something???

Thank you in advance

P.S. i allowed anonymous to view the new section.

Maxime Thomas

Wednesday 16 April 2008 11:24:48 pm

Can you provide the override settings , please ?

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Mihai007 Pop

Thursday 17 April 2008 12:24:24 am

Okay - I have used the admin interface only to create a new template override! So I did not play with the override.ini.append.php file.

But here it's what's happening. I have a siteaccess called "aliman". Inside it there is this file called override.ini.append.php. I opened it and I found the following two things of interest to me:

[full_folder]
Source=node/view/full.tpl
MatchFile=full/folder.tpl
Subdir=templates
Match[class_identifier]=folder


[full_folder_products]
Source=node/view/full.tpl
MatchFile=full_folder_products.tpl
Subdir=templates
Match[class_identifier]=folder
Match[section]=6

The latter part (full_folder_products) was created using the admin interface. I clicked on design/templates/node/view/full.tpl. Here there is a whole bunch of templates for full product, article, etc...

Anyway so I clicked on "New Override" at the bottom.

Step 1. Here I chose extension "ezwebin". Okay I tried "no extension" as well but same result. Actually when I chose "ezwebin" I could no longer remove the file and it seems to look for it inside the root folder called design. It's like a mismatch somewhere.

Step 2. I gave it a filename: "full_folder_products"

Step 3. Class: I chose "Folder"

Step 4. Section: I chose "Products" This section I did inside setup/sections. I also assigned it to the frontpage called "Products" from the standard ez installation. I also checked that everything under this node is part of the "products" section which they are. I also gave anonymous user rights to view this new section.

Step 5. I chose a copy of the default template (I actually copied the content of the standard full_folder.tpl file...! I then modified it to add columns and so on...! I just want to represent all the products in a column format where the folder is for products. and the rest of the website to have the normal list display (one underneath each other one).... !

Now I tried removing all the templates, and so on...!

I made it work by doing the following:

Step 1. I went physically inside the folder :
\extension\ezwebin\design\ezwebin\override\templates\full

Step 2. I copied the file folder.tpl and called the new one folder_products.tpl where I implemented my column view

Step 3. I went inside the override.ini.append.php and copied the part where it says:

But here it's what's happening. I have a siteaccess called "aliman". Inside it there is this file called override.ini.append.php. I opened it and I found the following two things of interest to me:

[full_folder]
Source=node/view/full.tpl
MatchFile=full/folder.tpl
Subdir=templates
Match[class_identifier]=folder

and I made it be:

[full_folder]
Source=node/view/full.tpl
MatchFile=full/folder.tpl
Subdir=templates
Match[class_identifier]=folder

[full_folder]
Source=node/view/full.tpl
MatchFile=full_folder_products.tpl
Subdir=templates
Match[class_identifier]=folder
Match[section]=6

Now it works properly! I can now go to products and view a column layout, and I can go to a normal folder and view a normal list layout...!

But - it does not look right! I mean why must I go into the physical file system itself and modify? isn't the admin meant to do that???

And I have one big problem. I cannot acces the template for the standard folder view within the admin any more.

Can you help me, please? I hope this was as informative as possible :) I tried the docs and all! I am sure it used to work the way I described at the beginning.

Thank you in advance...

Yours Mihai

Maxime Thomas

Thursday 17 April 2008 10:43:38 pm

Hi,

What you can do to know if you have loaded the right template is to enable the debug for your siteacess an enable the list of templates.
At tehend of the debug you will have a table showing :
- what is asked
- what it is supposed to be loaded
- what is actually loaded
It's very usefull when you don't know what eZ really does.

Another point, you cannot have two override with the same name, they must have unique id (full_folder). The behavior of the override file is to load the first section settings it can find, so others sections with the same name are never loaded.

You may find more information here.

http://ez.no/doc/ez_publish/technical_manual/4_0/templates/the_template_override_system

As a rule of thumb, I suggest you to totally read the Concept and basics chapter of the online documentation. It contains a lot of important things.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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 11:39:09
Script start
Timing: Jan 18 2025 11:39:09
Module start 'layout'
Timing: Jan 18 2025 11:39:09
Module start 'content'
Timing: Jan 18 2025 11:39:10
Module end 'content'
Timing: Jan 18 2025 11:39:10
Script end

Main resources:

Total runtime0.8881 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.9141152.6250
Module start 'layout' 0.00660.0028 740.539139.4453
Module start 'content' 0.00940.8773 779.9844570.3984
Module end 'content' 0.88670.0014 1,350.382816.1641
Script end 0.8881  1,366.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3917160.0002
Check MTime0.00140.1545160.0001
Mysql Total
Database connection0.00100.108610.0010
Mysqli_queries0.818392.1414600.0136
Looping result0.00060.0696580.0000
Template Total0.847095.420.4235
Template load0.00210.234120.0010
Template processing0.844995.132220.4225
Template load and register function0.00020.022610.0002
states
state_id_array0.00220.245610.0022
state_identifier_array0.00070.081320.0004
Override
Cache load0.00180.2063540.0000
Sytem overhead
Fetch class attribute can translate value0.00060.062620.0003
Fetch class attribute name0.00170.191150.0003
XML
Image XML parsing0.00060.065920.0003
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00100.1091160.0001
String conversion0.00000.001040.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs