You can use the Velocity macro,
http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity+Macro#HExample2
, and you can check if the old version exists with
$xwiki.exists($oldDocReference), see
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/platform/xwiki-platform-oldcore/5.2.2/xwiki-platform-oldcore-5.2.2-javadoc.jar/!/com/xpn/xwiki/api/XWiki.html#exists%28java.lang.String%29
.

Hope this helps,
Marius

On Tue, Dec 10, 2013 at 4:08 PM, Aye Jaye <[email protected]> wrote:
> I have these main documents which I want to consist of a bunch of 
> "subdocuments", which are included/transcluded (own context, so I'll use 
> Display, I guess).
> Main  |  -> A  |  -> B
> This document has two versions, New and Old:     Main_New  |  -> A_new  |  -> 
> B_new
> Main_Old  |  -> A_old  |  -> B_old
> Which is all fine as long as there exists New documents. Now to the finicky 
> part.
> In some cases, there will be no "new" document for B. I then want this to 
> happen:
> Main_New  |  -> A_new  |  -> B_old
> Main_Old  |  -> A_old  |  -> B_old  So, I want the Main document to include a 
> sub-document of it's own type if it exists, and if not, it should pick the 
> "older" document. The selection is based on the "main" documents properties.
> (Note: I'm having actual new/old documents, so it's not versions of the same 
> document. Also, I have simplified my example a bit, the real case has 
> multiple levels of inclusion. )    Q: How do I go about creating a good 
> conditional inclusion?
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to