Question

I know it's certainly a naive question but I couldn't figure out the answer by reading the scattered (and sometimes outdated docs) so I'm a bit confused. What's the conceptual meaning of all these view layer components and what's the difference between them? When should I use which?

I'd really appreciate if someone could shed a light on this. TIA,

Was it helpful?

Solution

A view is a basic component; it adapts a context and the request, so this component can apply data from the request and the context to produce.. something.

A page is a specialized view; it produces output aimed at the browser. It usually involves a template.

A viewlet and viewlet manager are closely tied together. A viewlet is a specialized view that is not meant to be used on it's own but is used in an assembly. The viewlet manager does the assembling here; you ask a viewlet manager for all the viewlets that are registered with that manager and are active. Viewlets are usually things like the login link, the personal information bar for logged-in users, etc. The login link would only be active if there is no logged in user, the personal bar only active if there is a logged in user, etc.

Basically, viewlets let you delegate the responsibility of a certain 'area' of rendered pages to components, where a manager handles one specific area and viewlets are the components that are used to render the snippets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top