View Modes - Bug or stupidity?

Author Message

Tristan Koen

Wednesday 23 July 2003 7:03:05 am

I have encountered some strange behaviour on ez3.1-1 when creating custom view modes.
If I create a new view template - say myview.tpl - and copy it across in to my /design/mysite/override/templates/node/view directory, it works perfectly with
{node_view_gui view=myview content_node=$Section:item}

The problem comes in when I try to restrict the template to a specific class - in my case, folders. My understanding is that the restriction is handled by changing the filename. So in my case I rename the template to myview_class_1.tpl and it *should* work.

For some reason it doesn't and I am getting quite frustrated here. Can anyone shed some light on this problem? Is it a bug or am I just extremely stupid?

Regards,

Tristan

Michael Bolien

Wednesday 23 July 2003 7:37:02 am

Hi Tristan, it's not your stupidy, it's because they change the template override behaviour in 3.1.1.

I encountered the same phenomenon. And you have two choices: first you can setup
{node_view_gui view=myview_class_1.tpl content_node=$Section:item}
this will show your template for all classes
or
you can use the new override.ini.append in your settings/siteaccess/design-folder. Here you have to enter in the override.ini.append:
[myview]
Source=node/view/full.tpl
MatchFile=myview.tpl
Subdir=templates
Match[class]=1

in your template you should enter:
{node_view_gui view=full content_node=$Section:item}

That should do it.

Michael

Tristan Koen

Thursday 24 July 2003 12:15:56 am

Thanks Michael. Now that I think about it, it does make sense in terms of presenting a consistent override framework.

ezTeam: Please would you remove the 'old style' view mode templates from the demo in the next release? I have used the demo as a source of examples for most of my learning curve and this one really caught me out...

Regards,

Tristan

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 16:03:41
Script start
Timing: Jan 18 2025 16:03:41
Module start 'layout'
Timing: Jan 18 2025 16:03:41
Module start 'content'
Timing: Jan 18 2025 16:03:42
Module end 'content'
Timing: Jan 18 2025 16:03:42
Script end

Main resources:

Total runtime0.8414 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.9141152.6250
Module start 'layout' 0.00480.0027 740.539139.4453
Module start 'content' 0.00750.8324 779.9844471.0781
Module end 'content' 0.83990.0014 1,251.062512.1641
Script end 0.8413  1,263.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3797160.0002
Check MTime0.00120.1464160.0001
Mysql Total
Database connection0.00060.067910.0006
Mysqli_queries0.798794.9308570.0140
Looping result0.00040.0513550.0000
Template Total0.812596.620.4062
Template load0.00220.259220.0011
Template processing0.810396.308120.4051
Template load and register function0.00010.013210.0001
states
state_id_array0.00070.083810.0007
state_identifier_array0.00110.136220.0006
Override
Cache load0.00180.2175310.0001
Sytem overhead
Fetch class attribute can translate value0.00080.094520.0004
Fetch class attribute name0.00090.103730.0003
XML
Image XML parsing0.00020.023720.0001
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00050.0643100.0001
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs