Jörn Nettingsmeier wrote:
hi everyone!
i have a publication in lenya 1.4 that does not currently have its own
sitemap.xmap (it inherits it from the default). i don't want to copy and
modify it, since it scares me. instead i'm trying to write a very short
sitemap that mounts the template's sitemap and will take some local
modifications later.
2 questions:
the 1.2 docs mention both "sitemap.xmap" and "publication-sitemap.xmap".
what are they both for? is this distinction still used in 1.4, or does
everything go into sitemap.xmap?
publication-sitemap.xmap was moved into sitemap.xmap in 1.4
how do i use the fallback mechanism? i find the syntax very confusing
and inconsistent. sometimes it's "fallback:///somefile" (which makes
sense to me), and sometimes it's "{fallback:somefile}" which does not.
specifically, why does this sitemap not work?
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:match pattern="**">
<!--
<map:mount src="../default/sitemap.xmap" uri-prefix=""
check-reload="yes" reload-method="synchron"/>
-->
<map:mount src="{fallback:sitemap.xmap}" uri-prefix=""
check-reload="yes" reload-method="synchron"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
(the commented section does work as expected, and the other mount call
causes a 500 error.)
i also tried fallback://sitemap.xmap with one, two and three slashes.
all throw a 500.
Try using the template source factory instead of the input module (with
out the brackets). I just tried this in a pub that uses another pub as
a template the uses the default pub as a template:
<map:mount src="fallback:///sitemap.xmap" uri-prefix=""
check-reload="yes" reload-method="synchron"/>
This froze up my jetty instance though because I put it into
mypub/sitemap.xmap which caused an endless mounting loop.
Try using the template-fallback source factory if you want to only look
at ancestor pub template resources. Sorry, no documentation yet other
than a mention of the idea here
http://lenya.apache.org/1_4/reference/publication-templating/index.html#XSLT+Include+and+Import
<map:mount src="template-fallback:///sitemap.xmap" uri-prefix=""
check-reload="yes" reload-method="synchron"/>
The template-fallback source factory comes in really handy for
overriding these types of "I want to use a modified version of my
templates resource, but I don't necessarily want to maintain two
versions of that resource" problems.
css example (functionality provided by template-fallback source factory
used in resources-shared.xmap):
/* templated pub's default.css */
@import url(default.inherited.css);
html { background: #436468; }
tia,
jörn
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]