Making other views URL addressable

Author Message

Deane Barker

Wednesday 10 August 2005 8:14:07 am

eZ publish templating is very "object based," meaning each view is a view of an object.

But what if I want two full views of the same object?

I have a folder with full view that displays some detailed information about the last three items put into the folder.

I want an "archive" view that shows everything in the folder.

I could create another view ("archive"), but then how would that be URL-addressable? When a node is URL-addressed, it defaults to the "full" view, correct?

I know there's the "old" style URLs: (/content/view/full/107). Is this how I'd need to address the object?

Paul Borgermans

Wednesday 10 August 2005 8:21:31 am

Hi Deane

You could use custom parameters to achieve this while retaining the nice urls:

Say for example that your default (full) view is to display the latest, then you can add a link that reads like http://mysite.com/nice/url/tofolder/(viewmode)/archive

In your full view template check this custom parameter and use a switch in your full template, possibly calling the "archive" template with {node_view_gui ... view="archive"} if you want it in a separate template file.

hth

-paul

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

Deane Barker

Thursday 11 August 2005 11:34:36 am

I see, thanks.

But, general speaking, when someone hits the URL of a node, the "full" view is the only view they're getting, is this right?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.