Forums / Developer / different designs for on node/object

different designs for on node/object

Author Message

gregor de Lijzer

Friday 29 July 2005 1:55:16 am

imagine following case:
i got a patient defined as a container containing various objects like lab results,...
now i want to view the patient but with different designs e.g showing only the patients lab results, x-rays or just a touchscreen version of that node.
The problem seems simple, but i haven't found a solution neither in the forum nor in the book.
so please forum - pimp my ezP application!
thanks greg

David Eriksson

Friday 29 July 2005 2:16:30 am

Perhaps you could create your own templates, similar to the full/plain/line ones? Then you can just use node_view_gui to display them.

/David

gregor de Lijzer

Friday 29 July 2005 2:36:15 am

i already defined a template named patient_full_lab.tpl which shows the patients data and only his lab results. But how does the link look like to show the patient using this template. Do i have to define something in the override.ini?

Eivind Marienborg

Friday 29 July 2005 4:42:20 am

Not sure if I understand you correctly, but I'll give it a try :)

If you want to show the lab result/x-ray/etc, and nothing else on the page (none of the menus, headers, footers etc you usually have), then you should override the pagelayout.tpl.

If you for example need this view on lab result, EKGs and x-rays, you could make a pagelayout that only displays the {$module_result.content}, and make your own view to override the full view on these items. Overriding the pagelayout.tpl on the relevant classes shouldn't be any problem.

My 2 cents in, hope you succeed in making what you want :)

gregor de Lijzer

Friday 29 July 2005 6:19:04 am

thanks!
But i don't want a completly new pagelayout. Everything remains the same(header, left menu,...).
the only thing changes, is the view in the main area. almost the node remains the same. but one template should show the patient info with the lab results, another template shows the patient info with the ECGs,...

greg

Luc Chase

Friday 29 July 2005 6:27:01 am

Gregor,
in addition to using different style-sheets to control what is visible (and its layout) according to the display device (mobile, print, audio, etc.), you can set the layout which ezp selects by inserting layout/set/<layout> as in layout/set/print.
See....
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/layout

The Web Application Service Provider

gregor de Lijzer

Saturday 30 July 2005 9:33:56 pm

o.k.
But in my eyes this makes sense if you only want to reorganize the look of your app. But is this the solution if i want to have different layouts for one node?

greg

Luc Chase

Sunday 31 July 2005 11:47:04 pm

I may not be understanding your issue. Perhaps you just need an override in your override.ini ? How (and when) do you want the user to select a layout? Do you want it selectable when the content is created or when it is being viewed etc.?

The Web Application Service Provider

K259

Monday 01 August 2005 5:55:20 am

Hi!

Yes, you have to define it in override.ini.

[full_node_yournodeid]
Source=node/view/full.tpl
MatchFile=node/view/patient_full_lab.tpl
Subdir=templates
Match[node]=yournodeid

Then you can access it with something like:
http://www.yoursitename.domain/content/view/full/yournodeid

gregor de Lijzer

Monday 01 August 2005 11:55:16 am

o.k. this is clear to me, but that's not really the/my problem. imagine a patient container has different items like a lab result,ecg. Nowi want the user to see the patients info and below the selected values. i try to make an ascii gui below

--------------------------------------------
Here's my header bla, bla,....
       DOE, John *22/07/1977
LAB   | Trop ... 1,4
ECG   | Mg   ... 105
X-RAY | Cl   ... 125
--------------------------------------------

By clicking LAB on the left side i want the lab results, stored in the patient container, shown below the patient info like shown above. The same with ECG,...
In my eyes all these templates are node/view/full ?

greg

Luc Chase

Monday 01 August 2005 12:06:57 pm

ok.... I THINK I understand what your're trying to do.
In your example I think (having done your data normalisation and identified your entities/classes) you need to define a content class for each (entity) type of content i.e. one for ECG another for X-RAY etc.
You then need to create an override of the full.tpl for each of the above types.
Then in the overrides.ini you create override rules, each targeting the specific class.
So, your overrides might be something like so...

[full_node_yournodeid]
Source=node/view/full.tpl
MatchFile=node/view/patient_full_lab.tpl
Subdir=templates
Match[class_identifier]=lab

The Web Application Service Provider

David Eriksson

Tuesday 02 August 2005 12:26:49 am

That's how I would do it as well I think. Let LAB, ECG, etc be children-objects to the Patient object, and it shouldn't be too hard to accomplish what you want.

The only other way I could think of is using variables to display different information using the same template. But that's an 'uglier' solution in my eyes.

/David

gregor de Lijzer

Sunday 07 August 2005 1:14:23 am

Thanks for the suggestions. Unfotunately i am on holiday right now ;) so will try it when i am back and will post my experiences.

thanks and greetings from spain/mallorca

greg

eZ debug

Timing: Jan 19 2025 03:24:29
Script start
Timing: Jan 19 2025 03:24:29
Module start 'content'
Timing: Jan 19 2025 03:24:30
Module end 'content'
Timing: Jan 19 2025 03:24:30
Script end

Main resources:

Total runtime0.8678 sec
Peak memory usage4,096.0000 KB
Database Queries230

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.9766180.8281
Module start 'content' 0.00630.7260 769.8047767.2578
Module end 'content' 0.73230.1354 1,537.0625353.3047
Script end 0.8677  1,890.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5104210.0002
Check MTime0.00160.1848210.0001
Mysql Total
Database connection0.00120.141810.0012
Mysqli_queries0.754186.90062300.0033
Looping result0.00220.25522280.0000
Template Total0.840296.820.4201
Template load0.00220.256620.0011
Template processing0.838096.565920.4190
Template load and register function0.00020.026210.0002
states
state_id_array0.00070.079710.0007
state_identifier_array0.00060.073520.0003
Override
Cache load0.00210.2429750.0000
Sytem overhead
Fetch class attribute can translate value0.00260.299460.0004
Fetch class attribute name0.00100.1132150.0001
XML
Image XML parsing0.00360.414860.0006
class_abstraction
Instantiating content class attribute0.00000.0048200.0000
General
dbfile0.00951.0959330.0003
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 49
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs