Forums / Developer / is it possible to create more than one view for same object?

is it possible to create more than one view for same object?

Author Message

Tofig Hamidov

Monday 05 July 2004 4:39:10 pm

Dear colleagues,

I begin experimenting with EZ and just completed 'Building an EZ publish site' manual. In the building news archive section of the website they used quite interesting approach and instead of making another object they just created another representation of the news folder (archive view). I was wondering whether it is possible to create more than one view for same object. Something like 'last month archive' and 'complete archive' views for example... Does anyone have ever done something like that?

Thanks in advance!

Tofig

Paul Borgermans

Monday 12 July 2004 12:30:45 pm

I hope you already found this out, but yes it can fairly easily be done.

One way is to create new viewmodes (other than full, line, ..) by creating a new template in the <b>/design/<yourdesign>/templates/node/view</b> directory. You can then also use overrides on this new "view mode".

Another way is to use userdefined parameters, eg

http://www.example.com/content/view/full/(fullmonth)/yes

and use the value set in $view_parameters.fullmonth to change the template logic accordingly.

hth

-paul

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