Forums / Developer / 2 override templates bug

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 ;)

eZ debug

Timing: Jan 31 2025 06:24:55
Script start
Timing: Jan 31 2025 06:24:55
Module start 'content'
Timing: Jan 31 2025 06:24:55
Module end 'content'
Timing: Jan 31 2025 06:24:55
Script end

Main resources:

Total runtime0.2237 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.0059 587.9297180.8359
Module start 'content' 0.00590.0054 768.765697.8672
Module end 'content' 0.01140.2122 866.6328526.1484
Script end 0.2236  1,392.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00361.6148200.0002
Check MTime0.00140.6195200.0001
Mysql Total
Database connection0.00090.385010.0009
Mysqli_queries0.172777.19391410.0012
Looping result0.00140.60951390.0000
Template Total0.211994.710.2119
Template load0.00090.405110.0009
Template processing0.211094.309310.2110
Override
Cache load0.00070.293710.0007
Sytem overhead
Fetch class attribute can translate value0.00060.281210.0006
XML
Image XML parsing0.00020.096610.0002
General
dbfile0.00883.9401200.0004
String conversion0.00000.002730.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