Forums / Setup & design / creating view_mode_gui

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 !

eZ debug

Timing: Jan 18 2025 11:08:17
Script start
Timing: Jan 18 2025 11:08:17
Module start 'content'
Timing: Jan 18 2025 11:08:18
Module end 'content'
Timing: Jan 18 2025 11:08:18
Script end

Main resources:

Total runtime0.8485 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.7031180.8438
Module start 'content' 0.00730.7192 768.5469609.1172
Module end 'content' 0.72650.1220 1,377.6641337.0703
Script end 0.8485  1,714.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00480.5623210.0002
Check MTime0.00190.2273210.0001
Mysql Total
Database connection0.00090.108910.0009
Mysqli_queries0.766290.29032040.0038
Looping result0.00240.28212020.0000
Template Total0.817796.420.4088
Template load0.00300.354820.0015
Template processing0.814696.005320.4073
Template load and register function0.00020.023710.0002
states
state_id_array0.00110.132010.0011
state_identifier_array0.00090.104920.0004
Override
Cache load0.00260.3088510.0001
Sytem overhead
Fetch class attribute can translate value0.00130.156250.0003
Fetch class attribute name0.00120.142560.0002
XML
Image XML parsing0.00340.395050.0007
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00510.6025270.0002
String conversion0.00000.000630.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs