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

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 31 2025 08:05:40
Script start
Timing: Jan 31 2025 08:05:40
Module start 'layout'
Timing: Jan 31 2025 08:05:40
Module start 'content'
Timing: Jan 31 2025 08:05:41
Module end 'content'
Timing: Jan 31 2025 08:05:41
Script end

Main resources:

Total runtime0.6996 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.1328151.2109
Module start 'layout' 0.00440.0018 739.343836.6484
Module start 'content' 0.00630.6926 775.9922965.4141
Module end 'content' 0.69890.0007 1,741.406315.8516
Script end 0.6996  1,757.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00270.3813160.0002
Check MTime0.00110.1559160.0001
Mysql Total
Database connection0.00080.108210.0008
Mysqli_queries0.639091.3343660.0097
Looping result0.00060.0793640.0000
Template Total0.670795.920.3354
Template load0.00180.255020.0009
Template processing0.668995.608020.3345
Template load and register function0.00120.175110.0012
states
state_id_array0.00100.144910.0010
state_identifier_array0.00060.081320.0003
Override
Cache load0.00150.2134410.0000
Sytem overhead
Fetch class attribute can translate value0.00120.165720.0006
Fetch class attribute name0.00200.284770.0003
XML
Image XML parsing0.00370.533220.0019
class_abstraction
Instantiating content class attribute0.00000.002280.0000
General
dbfile0.00600.8520170.0004
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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