Here’s some code that improves on the default Roller Weblogger blogroll code to ensure that if you include an image / icon for your blogroll entries it displays the image and the blogroll entry name (good if your using icons).
Using the default roller macro for displaying your blogroll means that no text is displayed if an image / icon URL is given. The default behaviour leaves rather empty lists of course, so I see this as an improvement.
So this code is effectively a replacement for “#showBookmarkLinksList($rootFolder false false)”, although it still uses the same CSS notation for lists, so as not to disturb your design.
It works with specific blogroll folders, so you do need to dictate which one your going to display (in the example below it’s “/My Blog Roll”). However this could be improved further to pick up the current folder name if you were to cycle through the sub folders (but I didn’t need it to do that, so I haven’t).
#set($rootFolder = $model.weblog.getBookmarkFolder("/My Blog Roll"))
#if ($rootFolder.bookmarks.size() > 0)
My Blog Roll
#foreach ($bookmark in $rootFolder.bookmarks)
-
$bookmark.name
#end
#end
- Recovered link: https://horkan.com/2008/08/11/roller-weblogger-improved-blogroll-code
- Archived link: https://web.archive.org/web/20100715131719/http://blogs.sun.com/eclectic/entry/roller_weblogger_improved_blogroll_code
- Original link:
http://blogs.sun.com/eclectic/entry/roller_weblogger_improved_blogroll_code