#** * Weblog entries, comments, and related links. * @author Lance Lavandowska (conversion to Velocimacros) * @author David M Johnson (comment macros) *# #** * Print status/error message if exists. * Note: "error" and "status" styles should be moved out into * invididual Themes' theme.css files. **# #macro( showStatusMessage ) #if( $errorMessage ) $errorMessage #end #if( $statusMessage ) $statusMessage #end #end #** * Set the META tag for ContentLanguage. We do this rather than * setting the Response header because the header does not get * cached. So in order to maintain the ContentType we must present * it inside the rendered page itself. **# #macro( showContentLanguage $lang ) #end #** * Use this macro in your day template if you want to override * entry rendering in both your HTML and RSS weblog output by defining * a page template named _entry. * *
It is no longer necessary to use a page template named _entry * if you want to override entry rendering in both your * HTML and RSS weblog output (for support of PagePlugins). * However, backwards compatibility for such use is still included, * or if you have some other need to override entry rendering. * The _entry page is now loaded by ContextLoader as $entryPage.
*# #macro( showEntryText $entry ) #if( $entryPage ) #parse($entryPage.id) #else #if ( $entry.plugins ) #set( $entryText = $pageHelper.renderPlugins( $entry ) ) #else #set( $entryText = $entry.text ) #end #if( $entryLength == -1 ) $utilities.textToCDATA($entryText) #else #set( $entryText = $utilities.textToCDATA($utilities.removeHTML($entryText)) ) $stringUtils.left( $entryText, $entryLength )... [$entryText.length() characters] #end #end #end #** * Use this macro in your day template if you want to override * entry rendering in both your HTML and RSS weblog output by defining * a page template named _desc. * *It is no longer necessary to use a page template named _desc * if you want to override entry rendering in both your * HTML and RSS weblog output (for support of PagePlugins). * However, backwards compatibility for such use is still included, * or if you have some other need to override entry rendering. * The _desc page is now loaded by ContextLoader as $descPage.
*# #macro( showEntryDescription $entry ) #if( $descPage ) #parse($descPage.id) #else #if ( $entry.plugins ) #set( $entryText = $pageHelper.renderPlugins( $entry ) ) #else #set( $entryText = $entry.text ) #end #if( $entryLength == -1 ) $utilities.textToXML($entryText) #else #set( $entryText = $stringUtils.left( $entryText, $entryLength ) ) #set( $entryText = $utilities.textToXML($utilities.removeHTML($entryText)) ) $entryText... [$entryText.length() characters] #end #end #end #** * Display Permalink for Date. * @param day Date object that specifies day (type java.util.Date). *# #macro( showDayPermalink $day ) #end #** * Display the default Date.toString for date using the 'macro.weblog.date.toStringFormat' * format as defined in the resource bundle. * @param toStringFormat Format string (see java.text.SimpleDateFormat). * @param day Date object that specifies day (type java.util.Date). *# #macro( showEntryDate $day ) #set( $format=$text.get("macro.weblog.date.toStringFormat") ) #formatDate( $format $day ) ##formatDate( $toStringFormat $day ) #end #** * Display the timestamp for the $day using the 'macro.weblog.date.timestampFormat' * format as defined in the resource bundle. * * @param timestampFormat Format string (see java.text.SimpleDateFormat). * @param day Date object that specifies day (type java.util.Date). *# #macro( showTimestamp $day ) #set( $format = $text.get("macro.weblog.date.timestampFormat") ) #formatDate( $format $day ) ##formatDate( $timestampFormat $day ) #end #** * Display the Permalink for a weblog entry. * @param entry WeblogEntry object. *# #macro( showEntryPermalink $entry ) Permalink #if ($pageHelper.isUserAuthorizedToEdit()) [$text.get( "macro.weblog.entrypermalink.edit" )] #end #end #** * Display the Trackback URL for a weblog entry. * @param entry WeblogEntry object. *# #macro( showTrackbackURL $entry ) $absBaseURL/trackback/$userName/$page.link/$utilities.encode($entry.anchor)#end #** * Display search form for searching a weblog. This is only a form, no div * or anything around it. *# #macro( showSearchForm ) #end #** * Display search again form *# #macro( showSearchAgainForm )$languageError
#end #set( $locales = $pageHelper.getSupportedLanguages() ) #if ($locales) #foreach($locale in $locales)$text.get("macro.weblog.nolanguages")
#end #end #** * Display links to Previous and/or Next chronological Entry. Also * display link to "main" page if either is present. **# #macro( showNextPreviousLinks ) #set( $npcat = 'nil' ) #set( $catLink = "" ) #if ( $catPath && $catPath != "") #set( $npcat = $catPath ) #set( $catLink = "?catname=$catPath" ) #end #end #** * Display link to chronologically previous entry in the * same category (if specified). **# #macro( showPrevEntryLink $category) #if( $pageModel.previousEntry ) #set( $prev = $pageModel.previousEntry ) #set( $prevURL = "$baseURL/page/${prev.website.user.userName}/#formatDate($plainFormat ${prev.pubTime})" ) #if ( $category != 'nil' ) #set( $prevURL = "$prevURL?catname=$category" )#end « $utilities.truncateNicely($prev.title, 30, 30, "...") #end #end #** * Display link to chronologically next entry in the * same category (if specified). **# #macro( showNextEntryLink $category) #if( $pageModel.nextEntry ) #set( $next = $pageModel.nextEntry ) #set( $nextURL = "$baseURL/page/${next.website.user.userName}/#formatDate($plainFormat ${next.pubTime})" ) #if ( $category != 'nil' ) #set( $nextURL = "$nextURL?catname=$category" )#end $utilities.truncateNicely($next.title, 30, 30, "...") » #end #end #** * Method to retrieve a full encoded anchor tag for a WeblogEntry. **# #macro( showAnchorTag $entry ) #end #** * Display a trackback auto-discovery comment for a WeblogEntry. **# #macro( showTrackbackAutodiscovery $entry ) #end