You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bardo Nelgen <ma...@bnnperformances.de> on 2015/11/10 11:35:24 UTC
Calling function in root sitemap flow
Hi all,
obviously I’m missing something:
Could anyone please point me towards the proper method of calling a
function in root sitemap flow (incl. passing parameters) from a
sub-sitemap’s matcher ?
Is this possible at all ?
Thanks for any hint !!
Best,
Bardo
RE: Calling function in root sitemap flow
Posted by Daniel Schmidt <Da...@tomtom.com>.
Hi Bardo,
there is no inheritance in what you're describing.
However, there's a workaround a lot of people are using:
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sitemap [
<!ENTITY import_global_resources SYSTEM "sitemap-resources.xmap">
]>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
...
</map:components>
<map:resources>
&import_global_resources;
</map:resources>
<map:pipelines>
...
</map:pipelines>
</map:sitemap>
---
Where sitemap-resources.xmap is just a plain file with what you'd normally include into your map:resources block. You can do the same with pipelines if you want.
That way you'd have at least a single source for your global sitemap resources. You can do the same in the sub sitemaps.
Please note: When you're changing the "sitemap-resources.xmap" file (name it how you want), then you have to restart cocoon or you have to save the including sitemap again to see your changes. If you have a lot of sub sitemaps, the former would be the better option of course.
Hope that helps!
Daniel
From: Bardo Nelgen [mailto:mailing.list.inbox@bnnperformances.de]
Sent: Dienstag, 10. November 2015 11:35
To: users@cocoon.apache.org
Subject: Calling function in root sitemap flow
Hi all,
obviously I'm missing something:
Could anyone please point me towards the proper method of calling a function in root sitemap flow (incl. passing parameters) from a sub-sitemap's matcher ?
Is this possible at all ?
Thanks for any hint !!
Best,
Bardo