Hi Matthias,
If you wish to modify the rendering of a document at runtime without changing its content
you can:
* Use a Sheet binding,
see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module. That’ll allow to
add stuff before and after the document’s content. That’s the simplest.
* Use a Transformation,
see
http://rendering.xwiki.org/xwiki/bin/view/Main/Extending#HAddinganewTransfo…
Thanks
-Vincent
On 16 Nov 2013 at 22:00:19, Matthias Wegner
(mic.mat.wegner@web.de(mailto:mic.mat.wegner@web.de)) wrote:
Hi All,
i want to put a {{warning}} in the header of a page when a specific macro is
not contained. How can i do that. I tried in a Listener when the needed
Macro-Block is not contained with
doc.getXDOM().getRoot().addChild(new WordBlock("{{warning}}Warning
Text.{{/warning}}"));
context.getWiki().saveDocument(doc, context);
This not works. What is the correct way to manipulate the Document DOM on
Load?
Regards,
Matthias