Forums / Setup & design / Section template override

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

eZ debug

Timing: Jan 18 2025 04:55:40
Script start
Timing: Jan 18 2025 04:55:40
Module start 'content'
Timing: Jan 18 2025 04:55:40
Module end 'content'
Timing: Jan 18 2025 04:55:40
Script end

Main resources:

Total runtime0.2701 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.7109180.8359
Module start 'content' 0.00930.0070 768.5469101.9922
Module end 'content' 0.01620.2538 870.5391530.7734
Script end 0.2700  1,401.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.3099200.0002
Check MTime0.00130.4938200.0001
Mysql Total
Database connection0.00120.462710.0012
Mysqli_queries0.212978.83101410.0015
Looping result0.00210.78101390.0000
Template Total0.253593.810.2535
Template load0.00090.334310.0009
Template processing0.252693.497610.2526
Override
Cache load0.00060.208710.0006
Sytem overhead
Fetch class attribute can translate value0.00090.326510.0009
XML
Image XML parsing0.00020.078510.0002
General
dbfile0.00782.8926200.0004
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs