#**
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. The ASF licenses this file to You
under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. For additional information regarding
copyright in this work, please see the NOTICE file in the top level
directory of this distribution.
*#
#**
Set of essential macros needed in Roller velocity templates.
These are the documented macros in order defined in this file:
#includeTemplate($weblog $pageName)
#showAutodiscoveryLinks($weblog)
#showTrackbackAutodiscovery($entry)
#showWeblogEntriesPager($pager)
#showNextPrevEntriesControl($pager)
#showWeblogEntryComments($entry)
#showWeblogEntryCommentForm($entry)
#showWeblogEntryLinksList($entries)
#showBookmarkLinksList($folderObj $expanding $subfolders)
#showWeblogCategoryLinksList($categoryObj $expanding $subcats)
#showReferrersList($weblog)
#showAtomFeedsList($weblog)
#showRSSFeedsList($weblog)
#showWeblogEntryCalendar($weblog $category)
#showPageMenu($weblog)
#showAuthorMenu($vertical)
#showWeblogSearchForm($weblog)
#showWeblogSearchAgainForm($weblog)
#showNextPrevSearchControl($pager)
*#
#**
Parse and include page template from weblog.
*#
#macro(includeTemplate $weblog $pageName)
#set($pageArg = false)## This is required for such constructs; see Velocity docs and ROL-689
#set($pageArg = $weblog.getPageByName($pageName))
#if ($pageArg)
#parse($pageArg.id)
#end
#end
#**
Show RSS, Atom and RSD auto-discovery links as HTML link elements.
*#
#macro(showAutodiscoveryLinks $weblog)
#if ($weblog.enableBloggerApi)
#end
#end
#**
* Display a trackback auto-discovery RDF comment for a WeblogEntry, but only
* if trackbacks are enabled and comments are allowed for the entry.
**#
#macro( showTrackbackAutodiscovery $entry )
#if($config.trackbacksEnabled && $model.weblog.allowComments && $entry.commentsStillAllowed)
#end
#end
#**
Shows weblog entries pager via default day template
*#
#macro(showWeblogEntriesPager $pager)
#set($dayPage = $model.weblog.getPageByName("_day"))
#set($map = $pager.getEntries())
#foreach($day in $map.keySet())
#set($entries = $map.get($day))
#parse($dayPage.id)
#end
#end
#** Show next/prev control for specified pager *#
#macro(showNextPrevEntriesControl $pager)
#set($prevLink = false)
#set($nextLink = false)
#if ($pager.prevLink)
#set($prevLink = $pager.prevLink)
#set($prevName = $pager.prevName)
#elseif ($pager.prevCollectionLink)
#set($prevLink = $pager.prevCollectionLink)
#set($prevName = $pager.prevCollectionName)
#end
#if ($pager.nextLink)
#set($nextLink = $pager.nextLink)
#set($nextName = $pager.nextName)
#elseif ($pager.nextCollectionLink)
#set($nextLink = $pager.nextCollectionLink)
#set($nextName = $pager.nextCollectionName)
#end
#if ($prevLink)
« $prevName |
#end
#if ($prevLink || $nextLink)
$pager.getHomeName()
#end
#if ($nextLink)
| $nextName »
#end
#end
#**
Show comments for weblog entry according to Roller configuration.
*#
#macro(showWeblogEntryComments $entry)
#end
#**
Show weblog entry calendar, with optional category restriction.
*#
#macro(showWeblogEntryCalendar $weblog $category)
$calendarModel.showWeblogEntryCalendar($weblog, $category)
#end
#**
Show large format weblog entry calendar, with optional category restriction.
*#
#macro(showWeblogEntryCalendarBig $weblog $category)
$calendarModel.showWeblogEntryCalendarBig($weblog, $category)
#end
#**
Show weblog author menu with vertical or horizontal orientation.
*#
#macro(showAuthorMenu $vertical)
$menuModel.showAuthorMenu($vertical)
#end
#**
Show search form for a weblog.
*#
#macro(showWeblogSearchForm $weblog $showCatChooser)
#end
#**
Show search again form for a weblog.
*#
#macro(showWeblogSearchAgainForm $weblog)
#foreach( $comment in $comments ) #if($comment.approved || $model.commentForm.preview) #if($config.commentEscapeHtml) #set($content = $utils.escapeHTML($comment.content)) #else #set($content = $utils.transformToHTMLSubset($utils.escapeHTML($comment.content))) #end #if($config.commentAutoFormat) #set($content = $utils.autoformat($content)) #end #set($content = $utils.addNofollow($content))
$text.get("macro.weblog.postedby") #if (!$utils.isEmpty($comment.name) && !$utils.isEmpty($comment.url)) $utils.escapeHTML($comment.name) #elseif (!$utils.isEmpty($comment.name)) $utils.escapeHTML($comment.name) #else $utils.escapeHTML($comment.remoteHost) #end $text.get("macro.weblog.on") $utils.formatDate($comment.postTime, $text.get( "macro.weblog.datepattern" )) #