Another one of the standard roller weblogger functions I replaced: the next / previous function. Basically I just wanted this to be a little more informative, and host it as a menu list in the sidebar.
Here’s a couple of examples:
- » Reading the main site
- » From Roller Weblogger Related Entries and Blog Post code
- » To: links for 2008-11-26
- » Forward: Next page
and
- » Reading Integrating Disqus and Roller Weblogger on blogs.sun.com
- » Backward: links for 2008-09-06
- » Forward: Setting up del.icio….
- » Return to main site.
And here’s the code (don’t forget to change the blog handle from ‘eclectic’):
<ul class="rEntriesList">
#if ($model.results)
<li class="recentposts">» Currently viewing search results... </li>
#else
#if($model.permalink)
<li class="recentposts">» Reading <a href="$url.entry($model.weblogEntry.anchor)">$model.weblogEntry.title</a> </li>
#if ($pager.prevLink)
<li class="recentposts">» Backward: <a href="$pager.prevLink">$pager.prevName</a> </li>
#end
#if ($pager.prevCollectionLink)
<li class="recentposts">» Backward: <a href="$pager.prevCollectionLink">$pager.prevCollectionName</a> </li>
#end
#if ($pager.nextLink)
<li class="recentposts">» Forward: <a href="$pager.nextLink">$pager.nextName</a> </li>
#end
#if ($pager.nextCollectionLink)
<li class="recentposts">» Forward: <a href="$pager.nextCollectionLink">$pager.nextCollectionName</a> </li>
#end
<li class="recentposts">» Return to <a href="http://web.archive.org/web/20090416190738/http://blogs.sun.com/eclectic/">main site</a>. </li>
#elseif($model.weblogCategory)
<li class="recentposts">» Reading entries related to the "<a href="$url.entry($model.weblogCategory.anchor)">$model.weblogCategory.name</a>" category </li>
<li class="recentposts">» From <a href="$url.entry($entryFirst.anchor)">$entryFirst.title</a> </li>
<li class="recentposts">» To: <a href="$url.entry($entryLast.anchor)">$entryLast.title</a> </li>
#if ($pager.prevLink)
<li class="recentposts">» Backward: <a href="$pager.prevLink">$pager.prevName</a> </li>
#end
#if ($pager.prevCollectionLink)
<li class="recentposts">» Backward: <a href="$pager.prevCollectionLink">$pager.prevCollectionName</a> </li>
#end
#if ($pager.nextLink)
<li class="recentposts">» Forward: <a href="$pager.nextLink">$pager.nextName</a> </li>
#end
#if ($pager.nextCollectionLink)
<li class="recentposts">» Forward: <a href="$pager.nextCollectionLink">$pager.nextCollectionName</a> </li>
#end
<li class="recentposts">» Return to <a href="http://web.archive.org/web/20090416190738/http://blogs.sun.com/eclectic/">main site</a>. </li>
#else
<li class="recentposts">» Reading the <a href="http://web.archive.org/web/20090416190738/http://blogs.sun.com/eclectic/">main</a> site </li>
<li class="recentposts">» From <a href="$url.entry($entryFirst.anchor)">$entryFirst.title</a> </li>
<li class="recentposts">» To: <a href="$url.entry($entryLast.anchor)">$entryLast.title</a> </li>
#if ($pager.prevLink)
<li class="recentposts">» Backward: <a href="$pager.prevLink">$pager.prevName</a> </li>
#end
#if ($pager.prevCollectionLink)
<li class="recentposts">» Backward: <a href="$pager.prevCollectionLink">$pager.prevCollectionName</a> </li>
#end
#if ($pager.nextLink)
<li class="recentposts">» Forward: <a href="$pager.nextLink">$pager.nextName</a> </li>
#end
#if ($pager.nextCollectionLink)
<li class="recentposts">» Forward: <a href="$pager.nextCollectionLink">$pager.nextCollectionName</a> </li>
#end
#end
#end
</ul>
Links for this article:
- Recovered link: https://horkan.com/2009/01/06/roller-weblogger-next-previous-macro
- Archived link: http://web.archive.org/web/20090416190738/http://blogs.sun.com:80/eclectic/entry/roller_weblogger_next_previous_macro
- Original link: http://blogs.sun.com/eclectic/entry/roller_weblogger_next_previous_macro