Forums / Setup & design / Notification and template override

Notification and template override

Author Message

laurent le cadet

Wednesday 18 February 2009 2:59:35 am

Hi,

I would like to send more (image, more infos) than a simple link while sending notifications but I'm not able to override notification templates.
I recreate the tamplates/notification/handler/ezsubtree/view/plain/plain.tpl but it doesn't seems to be enought.

As I don't want to hack the standard template, could someone tell me if there is an additionnal trick?

Regards.

Laurent

Norbert Wagner

Wednesday 18 February 2009 9:01:19 am

Hi Laurent, did you try to put an override condition in your override.ini file?
Regards,
Norbert

laurent le cadet

Wednesday 18 February 2009 9:25:53 am

Norbert,

As it's a bit different than to match a class identifier or a node, I don't really know how to write the override section.
Do you have an example?

In ezsubtreehandler.php, the .tpl is call like this:
$result = $tpl->fetch( 'design:notification/handler/ezsubtree/view/plain.tpl' );

But "design:" doesn't seems to be efficient.

Laurent

laurent le cadet

Wednesday 18 February 2009 9:37:55 am

Oups....

I did a mistake in the path : templates/notification/handler/ezsubtree/view<b>/plain</b>/plain.tpl

Sorry for this post

Norbert Wagner

Wednesday 18 February 2009 12:45:01 pm

Hi Laurent,
I've never exactly understood when a override directive is needed and when not.
But I would try it like this:

[plain_notification] 
Source=notification/handler/ezsubtree/view/plain/plain.tpl
MatchFile=path/to/your/template/plain.tpl
Subdir=templates

Hope that helps,

Norbert

laurent le cadet

Wednesday 18 February 2009 12:55:29 pm

Norbert,

My problem is solved because I realised that I made a mistake in the path to the file of my site design.

Override.

It's an important part of eZp.
In my case, no need to write a section in override.ini.
I just have to create a subtree in the site design.

Mothtly I use override.ini to declare a template for a new classe (and its different views) or a particular node like this:

[node_mycustomnode]
Source=node/view/full.tpl
MatchFile=full/mycustomnode.tpl
Subdir=templates
Match[node]=173

[full_mycustomclasse]
Source=node/view/full.tpl
MatchFile=full/mycustomclasse.tpl
Subdir=templates
Match[class_identifier]=mycustomclasse

Regards.

Laurent

Norbert Wagner

Thursday 19 February 2009 9:00:41 am

Hi Laurent,
yes the class template overrides are clear to me, thanks.
What I do not understand is the override of other parts of the system ...
Some times it seems to be enough to recreate the exact path in your design, other times it doesn't work and you have to write an override section. Here is an example were it doesn't work without:

[help_left_menu]
Source=parts/help/menu.tpl
MatchFile=parts/help/menu.tpl
Subdir=templates

Is there any logic I miss behind this?

Thanks,
Norbert

Stefano Bartoli

Friday 20 February 2009 11:55:03 am

Hi all,
I think that 'override.ini' overrides are for conditional overrides
(like for a specific node or class) while
placement overrides are for global 'override'.
I'm not completely sure about this because i've found different and strange behaviour, but perhaps it depends on fallback system.
Hope this is useful for you.

Stefano

eZ debug

Timing: Jan 18 2025 04:09:39
Script start
Timing: Jan 18 2025 04:09:39
Module start 'content'
Timing: Jan 18 2025 04:09:39
Module end 'content'
Timing: Jan 18 2025 04:09:39
Script end

Main resources:

Total runtime0.2299 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.0065 588.8516180.8281
Module start 'content' 0.00650.0044 769.6797102.0078
Module end 'content' 0.01090.2189 871.6875530.3281
Script end 0.2298  1,402.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00371.6009200.0002
Check MTime0.00140.6231200.0001
Mysql Total
Database connection0.00070.295310.0007
Mysqli_queries0.183979.97441410.0013
Looping result0.00160.67721390.0000
Template Total0.218695.110.2186
Template load0.00080.361810.0008
Template processing0.217894.712410.2178
Override
Cache load0.00060.247510.0006
Sytem overhead
Fetch class attribute can translate value0.00110.459310.0011
XML
Image XML parsing0.00020.091810.0002
General
dbfile0.00160.7015200.0001
String conversion0.00000.002630.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.0002 secs