Forums / Setup & design / Several designs for one node

Several designs for one node

Author Message

Karsten Jennissen

Friday 19 March 2004 7:10:00 am

I have the following situation:

- I have one central data repository of complex data structures under one node.
- The user should be able to access the data under different sorting methods, that from a user perspective represent different sections on the site, e.g. chronological, alphabetical, topics, etc.
- these methods should be displaid in different designs
- I DO NOT want to make a huge number of nodes for each data set so that I can assign different sections (and hence different designs) to them.

Is there any way to achieve this?

Karsten Jennissen

Friday 19 March 2004 8:00:56 am

First note to self: :-)
could this maybe be done with custom view modes?

Karsten Jennissen

Saturday 20 March 2004 3:01:09 am

After thinking about it for a while it seems it can only be done with view modes.

There is one issue with alternate view modes. I do not know how to implement nice urls and alternate view modes. Anyone has come up with a solution for this? What are your thoughts?

Paul Borgermans

Saturday 20 March 2004 2:29:24 pm

Hi Karsten

There is possibility to achieve what you want by custom template variable passing in templates. This works with nice urls (full view templates) as with content/view/full/<nodeid> urls. But you will have to back port some files of 3.4 (the current trunk in SVN) to the current stable version (3.3-3).

The files are

kernel/content/view.php
index.php
lib/ezutils/classes/ezmodule.php
lib/ezutils/classes/ezuri.php

With this you can add variables to your url as

http://my.ez.site/hello/there/(myvar)/myvalue

In your template, you access this variable as $view_parameters.myvar which should return myvalue. The good thing is that these variables are also part of the view cache key so you can still use view caching on.

hth

-paul

BTW: the above is part of production server running a mix of 3.3-stable from svn (> 3.3-3) with some mods of 3.4 (the above, delayed indexing, ezobjectrelationlist, ...) and a few of my own kernel patches. I also implemented the extra indexes posted by Emil and using his suggestion for query caching in MySQL 4. In spite of all this, the server runs nicely.

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Karsten Jennissen

Saturday 20 March 2004 3:25:21 pm

Thanks for your insights! This looks quite promising. I have checked the files you mentioned and as of now (it is 00:30 a.m. Sunday morning ;)) I am hesitant as to whether I should try to back-port.

As you may or may not know, I am not really what you would call PHP programmer, even though I have tried the odd occasional hack.

Anyway, I'll sleep over it will take into account what Balazs responds in the other thread: http://ez.no/community/forum/developer/sorting_articles

Right now I should be checking how easy it is to switch between nice urls and node-number urls. But...must...sleep... *yawn* :)

Paul Borgermans

Saturday 20 March 2004 3:28:59 pm

Karsten

Have a good night, we're in the same time zone ... but hey, isn't it party time now?

-paul

PS: I hope Balazs is right and I overlooked that this is part of the stable branch already, but I don't think so peeking agian in the svn repos

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

eZ debug

Timing: Jan 19 2025 09:47:31
Script start
Timing: Jan 19 2025 09:47:31
Module start 'content'
Timing: Jan 19 2025 09:47:32
Module end 'content'
Timing: Jan 19 2025 09:47:32
Script end

Main resources:

Total runtime0.7547 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 588.9531180.8359
Module start 'content' 0.00810.6194 769.7891574.7344
Module end 'content' 0.62750.1271 1,344.5234337.3750
Script end 0.7546  1,681.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.5511210.0002
Check MTime0.00150.1941210.0001
Mysql Total
Database connection0.00110.150710.0011
Mysqli_queries0.674589.38242030.0033
Looping result0.00220.29272010.0000
Template Total0.728896.620.3644
Template load0.00240.311820.0012
Template processing0.726496.261420.3632
Template load and register function0.00020.023710.0002
states
state_id_array0.00040.056910.0004
state_identifier_array0.00100.130420.0005
Override
Cache load0.00180.2376410.0000
Sytem overhead
Fetch class attribute can translate value0.00150.195630.0005
Fetch class attribute name0.00110.148470.0002
XML
Image XML parsing0.00090.113030.0003
class_abstraction
Instantiating content class attribute0.00000.002680.0000
General
dbfile0.00240.3208280.0001
String conversion0.00000.001030.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs