2 override templates bug

Author Message

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

Mazen Alsibai

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.1
and 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.

Marko Žmak

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?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Mazen Alsibai

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.

Marko Žmak

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.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Mazen Alsibai

Wednesday 24 August 2005 7:26:19 am

Okay ;)

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 20 2025 12:56:29
Script start
Timing: Jan 20 2025 12:56:29
Module start 'layout'
Timing: Jan 20 2025 12:56:29
Module start 'content'
Timing: Jan 20 2025 12:56:29
Module end 'content'
Timing: Jan 20 2025 12:56:29
Script end

Main resources:

Total runtime0.0139 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1563152.6250
Module start 'layout' 0.00460.0023 741.781339.4453
Module start 'content' 0.00690.0053 781.226697.3203
Module end 'content' 0.01220.0017 878.546938.3047
Script end 0.0139  916.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002115.3519140.0002
Check MTime0.00106.8652140.0001
Mysql Total
Database connection0.00074.868210.0007
Mysqli_queries0.001913.788630.0006
Looping result0.00000.065110.0000
Template Total0.001410.210.0014
Template load0.00075.298410.0007
Template processing0.00074.873310.0007
Override
Cache load0.00053.601410.0005
General
dbfile0.00117.771980.0001
String conversion0.00000.042940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs