This project is read-only.

One item (contentitem), multiple views?

Topics: Developer Forum
Apr 16, 2009 at 10:23 PM
Is it possible to have one item (the class in the items folder), but have multiple views?

For example, if I've extended the NewsItem with an image and some other properties, and I wan't to reuse this but present it in several different ways with different markup, how can I do this?

// Johan
Apr 17, 2009 at 12:04 AM
One way is to use the path after the item.

E.g. if the items url is


then you can make use of the remaining url to access another template

[Template("details", "~/detailsview.aspx")]
public class NewsItem : ContentItem

The path to this template would be

If you need this to be more dynamic you can either override FindPath or use an adapter concept, but that's slightly more tricky.