Override templates limitation

Author Message

Tristan Koen

Tuesday 29 July 2003 4:57:49 am

Hi All,

AFAIK, custom view modes have now been superseded by the override templates mechanism. As of this morning, I am not convinced that this is a good thing because of a limitation that I have now run into:

I have a folder called "News". In this folder are a number of news categories. In each of these categories are a number of articles.

On my landing page, I want to show a list of the latest 3 news items. The first item consists of the article title, an image and the intro text. The remaining two items only have the title.

On the news page, I want to show all articles with a title and intro text.

This simple scenario is very easy to implement, but it does highlight a weakness in the override templates approach.

My implementation takes the following approach:
1. Each of the main pages (News and Landing page in this scenario) have very simple templates. They simply fetch a list of folders that are displayed using:
{node_view_gui view=XXX content_node=$:item}
where XXX is a view mode that I would like to use.
2. I have two view nodes: latest (latest_class_1.tpl) and summary (summary_class_1.tpl).
3. The 'latest' and 'summary' view nodes are then responsible for displaying the appropriate fields for each view.

Now, as far as I can tell, this scenario CANNOT be implemented using override templates. That is unless the
Match[view_offset]=XXX statement does this... I can't quite figure out what view_offset is.

If I am wrong here, please will somebody tell me how. If I am right, would the ezCrew consider replacing the custom view mode functionality... It is really useful.

Regards,

Tristan

Pirkka Hartikainen

Tuesday 29 July 2003 5:37:08 am

This struck as being odd to me as well.. there's a definite need for the possiblity of configuring different templates for viewing a given content node in different contexts!

Tristan Koen

Tuesday 29 July 2003 5:48:56 am

Perhaps the solution would be to add a
Match[view_mode]=... option?

Pål Øystein Carlsen

Monday 17 November 2003 7:33:12 am

I would also like the possiblity to display the latest articles, regardless of what folder/node they are placed under. Is this possible?

If anybody has done this I would be happy to get a hint as to how. Now all I am able to get is a context sensitive display of articles depending on what section (parent_node) I am in.

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 19:07:39
Script start
Timing: Jan 18 2025 19:07:39
Module start 'layout'
Timing: Jan 18 2025 19:07:39
Module start 'content'
Timing: Jan 18 2025 19:07:40
Module end 'content'
Timing: Jan 18 2025 19:07:40
Script end

Main resources:

Total runtime0.7883 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 589.0313152.6250
Module start 'layout' 0.00730.0034 741.656339.4453
Module start 'content' 0.01070.7759 781.1016513.7813
Module end 'content' 0.78670.0016 1,294.882812.1641
Script end 0.7883  1,307.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4555160.0002
Check MTime0.00170.2107160.0001
Mysql Total
Database connection0.00080.098210.0008
Mysqli_queries0.725492.0186620.0117
Looping result0.00070.0904600.0000
Template Total0.741594.120.3708
Template load0.00220.274020.0011
Template processing0.739393.786920.3697
Template load and register function0.00020.027810.0002
states
state_id_array0.00160.203010.0016
state_identifier_array0.00260.330220.0013
Override
Cache load0.00180.2275280.0001
Sytem overhead
Fetch class attribute can translate value0.00150.186930.0005
Fetch class attribute name0.00200.256740.0005
XML
Image XML parsing0.00040.047930.0001
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00690.8786100.0007
String conversion0.00000.001240.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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 15
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs