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