how to create a viewmode for node

Author Message

Dhaval Patel

Wednesday 19 November 2008 10:26:26 pm

hello,

I want to create a new viewmode.

I am using ez 4.0

I tried by creating one temapate "newview.tpl" into the path "design\standard\templates\node\view\newview.tpl"

and from admin side I have overrided this file to two templates for different classes named "newview_class1.tpl" and "newview_class2.tpl" .

so now if I use the code below

      {node_view_gui content_node=$node view=newview}

then if the $node is the object of class "class1" then "newview_class1.tpl" should display and if the $node is the object of class "class2" then "newview_class2.tpl" should display .

but the ez does not render the overrided templates menas "newview_class1.tpl" and "newview_class2.tpl". it renders only "newview.tpl" file.

can anyone tell me why it is so ?

Thanks and Regards,

Dhaval Patel

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

Dhaval Patel

Thursday 20 November 2008 9:49:25 pm

hello,

I found.

I was overriding templates for another class and giving the different object of class as content_node.

Now it is ok.

Thank you very much...

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.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 31 2025 04:27:15
Script start
Timing: Jan 31 2025 04:27:15
Module start 'layout'
Timing: Jan 31 2025 04:27:15
Module start 'content'
Timing: Jan 31 2025 04:27:15
Module end 'content'
Timing: Jan 31 2025 04:27:15
Script end

Main resources:

Total runtime0.0389 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1406151.2109
Module start 'layout' 0.00570.0027 739.351636.6641
Module start 'content' 0.00840.0285 776.015690.0781
Module end 'content' 0.03700.0019 866.093829.9922
Script end 0.0388  896.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00256.5553140.0002
Check MTime0.00112.8418140.0001
Mysql Total
Database connection0.00082.065910.0008
Mysqli_queries0.00277.008030.0009
Looping result0.00000.033110.0000
Template Total0.00133.310.0013
Template load0.00102.475010.0010
Template processing0.00030.797410.0003
Override
Cache load0.00071.728510.0007
General
dbfile0.009123.398480.0011
String conversion0.00000.015340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs