General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
Macros
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Macros
Wiki source code of
Macros
Last modified by
Administrator
on 2010/09/23 14:50
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#macro(blog $category $nbitems $nbstart) #if(!$maxchars) #set($maxchars = 400) #end <div class="hfeed"> #if(!$category || $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") ## TODO: feed category #end #set($cdate = "") #set($inbitems = $xwiki.parseInt($nbitems)) #set($inbstart = $xwiki.parseInt($nbstart)) #foreach ($item in $xwiki.searchDocuments($sql, $inbitems, $inbstart)) #set($bentrydoc = $xwiki.getDocument($item)) #if($bentrydoc.fullName == $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 <div class="hentry"> <h4 class="heading-1-1-1 entry-title">$bentrydoc.display("title","view", $bentryobj)</h4> <div class="article_content entry-summary"> #set($content = $bentrydoc.display("extract", "view", $bentryobj)) #if($content=="") #set($content = $bentrydoc.display("content", "view", $bentryobj)) #if($content.length()>400) #set($i = $content.lastIndexOf(" ", $maxchars)) #set($i = $i + 1) #set($content = "${content.substring(0,$i)} [...>${bentrydoc.fullName}]") #end #else #set($content = "${content} [...>${bentrydoc.fullName}]") #end $bentrydoc.getRenderedContent($content) </div> ## entry-content <div class="article_footer"> #set($bcategories = $bentryobj.getProperty("category").value) Posted by <address class="author vcard">#userfn($bentrydoc.creator)</address> at <abbr class="published" title="#formatdateISO($bentrydoc.creationDate)">$xwiki.formatDate($bentrydoc.creationDate, "MMM dd, yyyy HH:mm")</abbr>#if($bcategories.size() > 0) in #foreach($bcategory in $bcategories)<a rel="tag" href="$xwiki.getURL("Blog.Category", "view", "category=${bcategory}")">$bcategory</a> #end#end #if($bentrydoc.date != $bentrydoc.creationDate) | Modified by <address class="author vcard">#userfn($bentrydoc.author)</address> at <abbr class="updated" title="#formatdateISO($bentrydoc.date)">$xwiki.formatDate($bentrydoc.date, "MMM dd, yyyy HH:mm")</abbr> #end | [$bentrydoc.comments.size() Comment(s)>${bentrydoc.fullName}?xpage=comments] | <a href="$bentrydoc.getURL("view")" rel="bookmark">Permalink</a> </div> ## article_footer </div> ## hentry #end #end ## ## prev/next links #if(($inbstart != 0) || ($velocityCount==$inbitems)) <div class="pagingLinks"> #if ($inbstart!=0) #set($iprev = $inbstart - $inbitems) <span class="prevPage">[Previous>$doc.name?nbstart=${iprev}]</span> #end #if($velocityCount==$inbitems) #set($inext = $inbstart + $inbitems) <span class="nextPage">[Next>$doc.name?nbstart=${inext}]</span> #end <span class="clear"></span> </div> ## pagingLinks #end </div> ## hfeed #end #blog($category $nbitems $nbstart)
Recent Blog Posts
First blog post
Blog Categories
News
(1)
Other
(0)
Personal
(0)
Blog Archive
2009
(1)