set template ?

Author Message

Martin Ulrich

Saturday 17 April 2004 2:23:26 pm

Is there a possibility to bring EZ to use another template dynamically?
in older version of EZ it works by URL:
content/view/my_template_name/id (instead of content/view/full/id)
but seems not in 3.4

I have an image album, based on album.tpl. What I want, is to click on a link, an than absolutely the same objects shown in a different view.

I dont want to modify pagelayout (so layout/set/... doesnt work), want to change a "sub"-template.

I want to change album.tpl to my_other_album.tpl, when click on a link.

The objects (images) have the same section, the same class, etc., therefor I can not do a static overide. So how can I tell EZ to use a different album.tpl from that is predefined in override.ini ?

sorry for my stupid artikulation

good night.

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Gunnstein Lye

Monday 19 April 2004 7:28:29 am

If I understand you correctly, you could use something like this in override.ini.append:

[album]
Source=node/view/album.tpl
MatchFile=album.tpl
Subdir=templates

Martin Ulrich

Friday 23 April 2004 5:31:26 am

Thank you!

I think that would work. But the problem is with "match".
The objects (images) are still the same - Same class, same section etc. ... So how can I distinguish them by match[]= ?

Assumed I have a list of Thumbnails. Click on one, show it in a medium size:
[image_medium]
Source=node/view/full.tpl
MatchFile=image_medium.tpl
Subdir=templates
Match[class]=5

Than I want to click once again on Image and should view in large size (with some additional infos):
[image_large]
Source=node/view/image_medium.tpl
MatchFile=image_large.tpl
Subdir=templates
Match[???]=?

how can I bring ez to use another override template? Is it possible to write something in URL or something with "set"

mmh :-) ... ...
;-O

thanks.

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Martin Ulrich

Friday 23 April 2004 6:01:55 am

now I find a solution. I create another override for plain.tpl content/view/plain

for first view I override content/view/full
alternate view I use override for content/view/plain

further question was, is there an .ini where I can define, which viewmodes EZ accepts? content/view/niceview

thanks
ciao

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Gunnstein Lye

Friday 23 April 2004 6:26:21 am

eZ publish accepts any viewmode, as long as there is an entry in override.ini for it.

I don't understand why you want to distinguish between the different views with "Match". Isn't it simpler to use the url? For example:
In image_medium.tpl, the link to the image would be /node/view/image_large/42
In image_large.tpl, the link to the image would be /node/view/image_medium/42

Then eZ publish will use the right template based on the url.

Martin Ulrich

Friday 23 April 2004 11:16:05 am

sorry! it seems that big javascript in template caused that site with other viewmodes is empty. however, at least one page works
http://www.artent.de/media/index.php/content/view/full/385
;-O

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

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 19 2025 15:14:17
Script start
Timing: Jan 19 2025 15:14:17
Module start 'layout'
Timing: Jan 19 2025 15:14:17
Module start 'content'
Timing: Jan 19 2025 15:14:18
Module end 'content'
Timing: Jan 19 2025 15:14:18
Script end

Main resources:

Total runtime0.5682 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.0313152.6094
Module start 'layout' 0.00480.0021 741.640639.4141
Module start 'content' 0.00680.5603 781.0547575.5313
Module end 'content' 0.56720.0010 1,356.585916.1953
Script end 0.5682  1,372.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.5021160.0002
Check MTime0.00120.2053160.0001
Mysql Total
Database connection0.00070.117210.0007
Mysqli_queries0.514390.5180660.0078
Looping result0.00060.1106640.0000
Template Total0.545896.120.2729
Template load0.00190.326120.0009
Template processing0.543995.726620.2720
Template load and register function0.00010.017610.0001
states
state_id_array0.00060.108910.0006
state_identifier_array0.00100.172020.0005
Override
Cache load0.00160.2824580.0000
Sytem overhead
Fetch class attribute can translate value0.00060.096820.0003
Fetch class attribute name0.00100.182070.0001
XML
Image XML parsing0.00060.113720.0003
class_abstraction
Instantiating content class attribute0.00000.003180.0000
General
dbfile0.00060.1068160.0000
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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
14content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 34
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs