Forums / Setup & design / Override templates limitation

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.

eZ debug

Timing: Jan 18 2025 16:27:26
Script start
Timing: Jan 18 2025 16:27:26
Module start 'content'
Timing: Jan 18 2025 16:27:27
Module end 'content'
Timing: Jan 18 2025 16:27:27
Script end

Main resources:

Total runtime1.3231 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.7109180.8359
Module start 'content' 0.00691.1455 768.5469518.8594
Module end 'content' 1.15240.1706 1,287.4063334.1328
Script end 1.3230  1,621.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3134210.0002
Check MTime0.00150.1146210.0001
Mysql Total
Database connection0.00080.060010.0008
Mysqli_queries1.260095.23711990.0063
Looping result0.00190.14731970.0000
Template Total1.295397.920.6477
Template load0.00170.130220.0009
Template processing1.293697.771220.6468
Template load and register function0.00010.010110.0001
states
state_id_array0.00120.089810.0012
state_identifier_array0.00140.102420.0007
Override
Cache load0.00140.1077280.0001
Sytem overhead
Fetch class attribute can translate value0.00130.099340.0003
Fetch class attribute name0.00090.066740.0002
XML
Image XML parsing0.00070.054840.0002
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00200.1521210.0001
String conversion0.00000.000530.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs