Forums / Developer / 2 override templates bug
Mazen Alsibai
Tuesday 23 August 2005 11:32:45 am
hi all : i am trying to create 2 override templare for the same class and same section,i used all ways to do that,but i failed, i simulate the example in the tutorial(archive example),but it doesnot work.can anyone lead me to do that?
Marko Žmak
Wednesday 24 August 2005 1:21:33 am
Could you give some more details? Explain exactly what are you trying to do, or copy-paste the override.ini for your siteacces.
And what does "it doesn't work" mean? Do you get an error or what?
Do you have Debug enabled, and what eZ version are you using?
-- Nothing is impossible. Not if you can imagine it! Hubert Farnsworth
Wednesday 24 August 2005 1:54:27 am
we are trying to make different views and edits for the same user profile, according to the user condition. I'm using 3.6.1and I'm using the debug.
the example in the tutorial shows how to make a new view for archive. It seems that archive is another task in the content module.My problem is that I'm trying to make another view and another edit for the same class in the same section and for the same task ( edit, view).
I don't know if this is possible. I want to know if I have to make a new view. if so, what are the new folders and files shall I make to make the new view?If I could make the new view and make override for the edit template, what is the url to see the first template, and what is the url to see the newer template.
Wednesday 24 August 2005 5:46:23 am
I supose that "user condition" is an attribute of the user class? If so, I think that you cannot do exactly what are you trying to do.
But there could be another way to do it... You could create only one override for the class and section and put in it some code similar to this:
{switch match=$user_node.object.data_map.mycondition} {case match=='cas_one'} {include uri='design:view1.tpl'} {/case} {case match=='cas_two'} {include uri='design:view2.tpl'} {/case}{/switch}
where view1.tpl and view2.tpl are different views for the same user. Also do this for edit view.
Does this help?
Wednesday 24 August 2005 6:26:57 am
no, "user condition" is not an attribute of the user class.it is an http parameter.
Now I'm using your suggested way,but I dreamed of a cleaner way.
Wednesday 24 August 2005 7:19:39 am
I don't think that there's a cleaner way, since you cannot use http parameters as override conditions. And also it seems logical that http parameters are handled in the template code, so this way doesn't seem so dirty to me.
Hope it works well.
Wednesday 24 August 2005 7:26:19 am
Okay ;)