I have a page that has both paragraph and quotation block contents that are mixed. I am able to get both with the following snippet of code:
#foreach ($block in $document.getXDOM().getBlocks('class:ParagraphBlock', 'DESCENDANT'))
#set ($xwikiSyntax = $services.rendering.render($block, "xwiki/2.1"))
$xwikiSyntax
#end
#foreach ($block in $document.getXDOM().getBlocks('class:QuotationBlock', 'DESCENDANT'))
#set ($xwikiSyntax = $services.rendering.render($block, "xwiki/2.1"))
$xwikiSyntax
#end
The one problem here though is that the content is not rendered in order (i.e. all the paragraph content is rendered and then the quoted content; I’d like them to be printed out in their original order)
How would I do this?
Thanks.