creating view_mode_gui

Author Message

Alexander Celle

Wednesday 16 July 2003 5:00:54 pm

Hi, I've been trying for several days to create new view modes and have not been able to do so.

I read somewhere in this site that it was as easy as creating a template in /override/content/node/view/newmode.tpl and then call it with mode=newmode.

I did that but it won't work. I even created the template in /standard/content/node/view/ and nothing happened.

Any ideas of what's wrong?m (my version is 3.1.1)
Thanks,
Alex

Claire Lin

Wednesday 16 July 2003 5:53:15 pm

Have you cleared all cache manually? WHen things do not work as expected I go to the cache directory and delete everything manually.

If cache is not an issue, the following is how I created my own view modes with "extension":
1. create the following directories under ezpublish folder
/extension/YOUREXTENSION/design/standard/templates/node/view (replace YOUREXTENSION with whatever you want to call your extension)

2. Let ezpublish knows about your newly created extension by adding the following line to
setting/override/site.ini.append.php: (create the directories and the file site.ini.append.php if they do not exist)
[ExtensionSettings]
ActiveExtensions[]=STEExtension

3.
Let ezpublish knows to look for extra template files under the design folder of YOUREXTENSION, add the following to /extension/YOUREXTENSION/settings/design.ini.append (create the directories and the file design.ini.append if they do not exist)
[ExtensionSettings]
DesignExtensions[]=STEExtension

4. Create any template file for your view mode. Say you want to use a mode called "simple". Create simple.tpl and put it in the directory you created in step 1(/extension/YOUREXTENSION/design/standard/templates/node/view).
5. Now you should be able to view any content node (for example node 123) by typing this url:
.../content/view/simple/123

I hope that I didn't miss any steps. Good luck.

Claire Lin

Alexander Celle

Wednesday 16 July 2003 9:44:57 pm

I followed your steps carefully and worked perfectly. I also found a couple of "official" pages with the help you gave me (btw, this extension system looks great!!)

The page is:
http://www.ez.no/developer/ez_publish_3/documentation/development/extensions/introduction_to_extensions

Although it does not mention the need for the design.ini file

Thanks for the help

Vicente Olivan

Friday 31 March 2006 9:16:39 am

Help, one question

Is necessary to create one extension for additional viewmodes templates?

Example

/design/base/override/templates/full/article.tpl
/design/base/override/templates/line/article.tpl
/design/base/override/templates/other_1/article.tpl
/design/base/override/templates/other_2/article.tpl

some other form to do it

Vasilii Pascal

Thursday 14 December 2006 4:29:39 am

Hi , thanks for your steps they help me too ,but to display only html :) .
How can i fetch any data from sometable and assign them to /node/view/sometemplate.tpl
Or what script or class is responding for this operation ,or how can i make my extention class be automatic executed by EZ on user site access .

sometemplate.tpl


{foreach $List_Arr as $rec}
{$rec.id}{$rec.name}
{/foreach}

 

thanks !

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:09:28
Script start
Timing: Jan 18 2025 16:09:28
Module start 'layout'
Timing: Jan 18 2025 16:09:28
Module start 'content'
Timing: Jan 18 2025 16:09:29
Module end 'content'
Timing: Jan 18 2025 16:09:29
Script end

Main resources:

Total runtime0.8283 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.9063152.6250
Module start 'layout' 0.00730.0044 740.531339.4453
Module start 'content' 0.01170.8152 779.9766604.0391
Module end 'content' 0.82690.0014 1,384.015612.1719
Script end 0.8282  1,396.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3949160.0002
Check MTime0.00130.1541160.0001
Mysql Total
Database connection0.00080.091810.0008
Mysqli_queries0.767592.6662670.0115
Looping result0.00070.0875650.0000
Template Total0.790295.420.3951
Template load0.00230.281820.0012
Template processing0.787995.121920.3939
Template load and register function0.00010.017410.0001
states
state_id_array0.00110.132510.0011
state_identifier_array0.00170.208320.0009
Override
Cache load0.00200.2427510.0000
Sytem overhead
Fetch class attribute can translate value0.00060.075240.0002
Fetch class attribute name0.00100.116660.0002
XML
Image XML parsing0.00080.101840.0002
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00120.1502160.0001
String conversion0.00000.001140.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs