General Actions:
Log-in
Wiki:
CreativeIT
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
Macros
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to the CreativeIT Wiki!
»
Latest Articles
»
Macros
Wiki source code of
Macros
Last modified by
Administrator
on 2007/04/10 08:05
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#macro(blog $category $nbitems $nbstart) #if(!$maxchars) #set($maxchars = 400) #end <div class="hfeed"> #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") ## TODO: feed category #end #set($cdate = "") #set($inbitems = $util.parseInt($nbitems)) #set($inbstart = $util.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"> <h3 class="entry-title"><a href="$bentrydoc.getURL()">$bentrydoc.display("title","view", $bentryobj)</a></h3> <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 (!$velocityCount) ## if $velocityCount has not been initialized (e.g. $xwiki.searchDocuments has returned an empty list) #set($velocityCount = -1) #end #if(($inbstart != 0) || ($velocityCount==$inbitems)) <div class="pagingLinks"> #if ($inbstart!=0) #set($iprev = $inbstart - $inbitems) <span class="prevPage">[Previous>$doc.name?category=$!category&nbstart=${iprev}]</span> #end #if($velocityCount==$inbitems) #set($inext = $inbstart + $inbitems) <span class="nextPage">[Next>$doc.name?category=$!category&nbstart=${inext}]</span> #end <span class="clear"></span> </div> ## pagingLinks #end </div> ## hfeed #end #blog($category $nbitems $nbstart)
Quick Links
Home
Index
What's New
Blog
Calendar
Photo Albums
Sandbox
Tags
Bulletin Board
My Recent Modifications
PamelaJennings
|
rwakkary
|
HaledenSands
|
ByronLahey