Consortium
Activities
Projects
Forge
Events
Log-in
Register
Macros
Space Menu
Consortium
|
Solutions
|
Middleware
|
Forge
|
MyObjectWeb
|
PDF
|
History
|
More Actions
View
Code
|
XML
|
Help
Documentation
|
XWiki Syntax
|
#macro(blog $category $nbitems $nbstart) #if($category=='') #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") #else #set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate desc") #end #set($cdate = "") #set($inbitems = $xwiki.parseInt($nbitems)) #set($inbstart = $xwiki.parseInt($nbstart)) #set($counter = 0) #foreach ($item in $xwiki.searchDocuments($sql, $inbitems, $inbstart)) #set($counter = $counter+1) #set($bentrydoc = $xwiki.getDocument($item)) #set($bentryobj = $bentrydoc.getObject("XWiki.ArticleClass")) #set($creationDate = $xwiki.formatDate($bentrydoc.creationDate,"MMMM dd, yyyy")) #if($cdate!=$creationDate) <div class="article_date"> $creationDate </div> #set ($cdate = $creationDate) #end 1.1.1 $bentrydoc.display("title","view", $bentryobj) <div class="article_content" > #set($content = $bentrydoc.display("extract", "view", $bentryobj)) #if($content=="") #set($content = $bentrydoc.display("content", "view", $bentryobj)) #if($content.length()>400) #set($i = $content.lastIndexOf(" ",400)) #set($i = $i + 1) #set($content = "${content.substring(0,$i)} ... [continue reading>${bentrydoc.fullName}]") #end #else #set($content = "${content} ... [continue reading>${bentrydoc.fullName}]") #end $bentrydoc.getRenderedContent($content) </div> <div class="article_footer" > Posted by $xwiki.getLocalUserName($bentrydoc.creator) at $xwiki.formatDate($bentrydoc.creationDate, "MMM dd, yyyy HH:mm") in $!bentrydoc.display("category","view", $bentryobj) | Modified by $xwiki.getLocalUserName($bentrydoc.author) at $xwiki.formatDate($bentrydoc.date, "MMM dd, yyyy HH:mm") | [$bentrydoc.comments.size() Comment(s)>${bentrydoc.fullName}?xpage=comments] | [Permalink>$bentrydoc.fullName] </div> #if($counter==$inbitems) <div style="float: right; margin-right: 30px"> #if ($inbstart!=0) #set($iprev = $inbstart - $inbitems) [Previous>$doc.name?nbstart=${iprev}] #end #set($inext = $inbstart + $inbitems) [Next>$doc.name?nbstart=${inext}] </div> #end #end #end #blog($category $nbitems $nbstart)