Jörn Nettingsmeier schrieb:
> hi everybody!
> 
> 
> i have a publication with two different types of XHTML pages:
> free-format pages and "project" pages. the former use the almost
> unmodified XHTML doctype. the latter need a slightly different layout.
> 
> i was about to create a new doctype module, but then i read
> http://lenya.apache.org/docs/1_4/tutorials/bestpractises.html :
> 
> <quote>
>   #  Use resource types sparingly. A new resource type adds complexity
>   to your application. It requires to patch cocoon.xconf and is
>   therefore a static element of your application. Most differences
>   between pages can be implemented by using different XSLTs or templates
>   in the presentation layer, or even using distinct samples to provide a
>   starting point for a certain type of page.
> </quote>
> 
> i don't know who wrote this (i guess it was andreas)... it sounds very
> compelling, but i have problems understanding how to use formats in
> practice.

I added a bit more documentation to the "Resource Types -> Formats"
section. It's not online yet.


> is there a way for a user to specify "make it look like a normal page"
> or "make it look like a project description page" without using two
> separate doctypes?

Sure - the documentation basically tells how to do that, if it's
too hard to understand please point out the particular section.


> it would also be ok to be able to say "all pages below the node
> '/projects' should look like project pages".

Sure:

<map:match pattern="*/**">
  <map:generate src="lenya-document:{p-e:document-uuid}?format={1}"/>
  <map:serialize type="xml"/>
</map:match>

In this simple example, the name of the top-level node would be the
format for all pages in the subtree. With a more sophisticated approach
the sitemap would become more complex, or you'd have to implement e.g.
a custom input module to detect the format to apply.


> i can imagine a zillion complicated ways to hack such features into
> lenya, but the docs seem to imply there is a much easier solution based
> on formats - can anyone provide an example?
> 
> the only way i've used formats before was for different views of pages,
> like searching or "printer-friendly",

Yes, that's the purpose of formats ...

> but these were handled in special
> pipelines... how can a format ever replace a dedicated doctype in a
> user-friendly way?

Formats can't replace resource types, they only provide a mechanism
to use the same content structure for different presentation options.

Maybe I don't quite understand your requirements, would you mind giving
more examples what you'd like to achieve?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to