Re: Self template use

Andreas Hartmann <[email protected]>
Newsgroups gmane.comp.cms.lenya.user
Message-ID <[email protected]>
Hi Florent,

Am 14.01.10 18:17, schrieb Florent André:
> As I fight with template, I have questions/remarks :
>
> - I create a publication "mypub" (by default template is inherited from
> "default pub")
>
> - But I want that mypub have a special design very different from the
> default one.
>
> - So after have a look at the pubs/mypub/publication.xml I see the tag
> <template id="default"/>. So ok, I write<template id="mypub"/>  and let's
> go... but after a restart, bug caused by infinite loop appear... not the
> solution !

yes, the publication can't use itself as a template. The template is the 
"parent" of the publication, it inherits all resources from the 
template. See

http://lenya.apache.org/docu20/reference/publications/publication-templating.html


> - After that, go to default publication.xml, and see that the tag<template
> id=""/>  was commented, so my deduction was : "If template tag commented,
> the pub use his own template", but when I do that (comment template tag in
> mypub publication.xml) I have a strange error [1] witch speak about a
> "menus.xmap resource not found" ( menus.xmap is mark as deprecated in the
> default publication sitemap)...

You have two options:

A) Use a template. Then your publication inherits everything (well, all 
resources that are referenced using the fallback protocol) from this 
template publication.

B) Don't use a template. Then your publication has to contain all 
necessary resources.


In most situations I'd recommend starting with option A and adding only 
the resources which are meant to replace template resources to your 
publication. So if you want a completely different layout but keep other 
features like workflow, just add the XSLT and CSS files to your publication.

HTH,

-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.