Consortium
Activities
Projects
Forge
Events
Log-in
Register
Photo Albums
Space Menu
Consortium
|
Solutions
|
Middleware
|
Forge
|
MyObjectWeb
|
PDF
|
History
|
More Actions
View
Code
|
XML
|
Help
Documentation
|
XWiki Syntax
|
1 Photo Albums {table} Photo|Title|Description|Comments #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.PhotoAlbumClass' and obj.name <> 'XWiki.PhotoAlbumClassTemplate' order by doc.creationDate desc") #foreach ($item in $xwiki.searchDocuments($sql)) #set($bentrydoc = $xwiki.getDocument($item)) #set($comments = $bentrydoc.getComments()) #if($comments.size()>0) #set($i = 0) #set($cobj = $comments.get($i)) #set($comment = $bentrydoc.display("comment", "view", $cobj)) #else #set($comment = "") #end #set($comment = $comment.replaceAll("\n","<br />")) #set($obj = $bentrydoc.getObject("XWiki.PhotoAlbumClass",0)) #if($bentrydoc.attachmentList.size()>0) #set($attach = $bentrydoc.attachmentList.get(0)) <img src="$bentrydoc.getAttachmentURL($attach.filename,"download")" height="50"/>|[$!{bentrydoc.display("title","view",$obj)}>$item] | $!bentrydoc.display("description", "view", $obj) | $!comment #else [No photo>$item]|[$!{bentrydoc.display("title","view",$obj)}>$item] | $!bentrydoc.display("description","view",$obj) | $!comment #end #end {table} 1.1 Add an Album #includeTopic("XWiki.XWikiCommonJavascript") <form action="" id="newdoc"> <input type="hidden" name="parent" value="Photos.WebHome" /> <input type="hidden" name="template" value="XWiki.PhotoAlbumClassTemplate" /> <input type="hidden" name="sheet" value="1" /> <input type="hidden" name="webname" value="Photos" /> <input type="hidden" name="name" value="" /> Wiki name of the album: <input type="text" name="title" value="short name no special chars" size="40"><input type="button" value="Add this Album" onclick='updateName(this.form.title, this.form.name); action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit();' /> </form>