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