Forums / Developer / new view for content edit

new view for content edit

Author Message

Aladdin Mouhaimeed

Monday 22 August 2005 9:26:28 am

in order to make another template for the edit function I have made:
"design/tscm/templates/content"
and in it:
"design/tscm/templates/content/edit.tpl"

is this right?
I tried then to override the template, but didn't find it in the templates pages.

what will the url be to edit an object with id 113 for example?

Yelitza Jaramillo

Monday 22 August 2005 11:18:52 am

hi,

if the id of the object is 113 then you can go to the url
content/edit/113 to edit it.

the reason why the system don't use your template might be because there is an override rule for the class of the object you are trying to look at, you can check this in settings/siteaccess/your_site/override.ini

Aladdin Mouhaimeed

Tuesday 23 August 2005 12:40:06 am

ok but you didn't answer me:

the tutorial says to make these folders:
"design/tscm/templates/node"
"design/tscm/templates/node/view"
and then to create this file:
"design/tscm/templates/node/view/archive.tpl"
and that was to make another template for the view.

now my question is:
in order to make another template for the edit (not the view), what folders and files shall I create.
and then, what is the url which tells ez which template to use, the first one or the newer one?

Yelitza Jaramillo

Tuesday 23 August 2005 1:17:47 am

>in order to make another template for the edit function I have made:
> "design/tscm/templates/content"
> and in it:
> "design/tscm/templates/content/edit.tpl"

> is this right?

Yes, this is right. By doing this you are overriding the edit template. So when you are trying to edit an object it should automatically use this template, unless there is an override rule for the class or the node you are looking at.

An override rule for the class "comment" for example looks like this:

[edit_comment]
Source=content/edit.tpl
MatchFile=edit/comment.tpl
Subdir=templates
Match[class_identifier]=comment

Aladdin Mouhaimeed

Tuesday 23 August 2005 3:28:45 am

very well,

Now I need to make another template which overrides edit too, let's name it custom_template.tpl,

and I want to use custom_comment.tpl sometimes, and sometimes I want to use comment.tpl

which are the urls who will make ez use each of the templates???

Yelitza Jaramillo

Tuesday 23 August 2005 3:25:39 pm

ok, lets say you have a class named "comment".

lets say that its shown with the template full/comment.tpl
and you make an override for this class custom_comment.tpl,

>and I want to use custom_comment.tpl sometimes, and sometimes I want >to use comment.tpl

based on what do you want to use comment.tpl and custom_comment.tpl??

Aladdin Mouhaimeed

Wednesday 24 August 2005 1:08:45 am

Yelitza,
I have user with many child objects,
I need to show or hide some of these objects according to the user condition.
Ok, I can pass a parameter and use if statements,
but this lead me to huge template files.
so I want to use two templates in the same section for the same class, for edit and for view.

my friend Mazen has summarized the problem in:
http://ez.no/community/forum/developer/2_override_templates_bug

eZ debug

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

Main resources:

Total runtime0.1875 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.7109180.8359
Module start 'content' 0.00600.0070 768.5469101.8672
Module end 'content' 0.01290.1745 870.4141526.5234
Script end 0.1874  1,396.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00412.2094200.0002
Check MTime0.00160.8394200.0001
Mysql Total
Database connection0.00060.312010.0006
Mysqli_queries0.140374.84451410.0010
Looping result0.00160.87871390.0000
Template Total0.174192.910.1741
Template load0.00090.476310.0009
Template processing0.173292.383710.1732
Override
Cache load0.00060.324310.0006
Sytem overhead
Fetch class attribute can translate value0.00110.608110.0011
XML
Image XML parsing0.00030.184510.0003
General
dbfile0.00241.3004200.0001
String conversion0.00000.002030.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs