11:55PM May 18, 2007 in category Apache Roller by Jesse Bethke

Organizing Bookmarks

The bookmarks section under the Create & Edit tab in your administrator allows you to manage links to your favorite sites.  Adding a bookmark will cause it to appear in the links section of your page.  However, you can further manage and organize your links by placing them in sub-categories.  For instance, notice to left how I have Links and then Fellow Bloggers.  Categories are organized in your bookmarks in a folder like structure.

When a link list is represented in a template, it displays all the links in the category specified; which by default is the root of your bookmarks.  Even so, it is not recursive.  This means that it won't display the links that are in subcategories (folders).

Adding Additional Link Lists to Your Template

In order for the bookmarks in subfolders to appear on your blog, you must setup a section in the template for them to be displayed.  The following example sets up a section for my fellow bloggers:

    <div class="sidebarbox" id="fellowBloggers">
      <h4>Fellow Bloggers</h4>
      #set($fellowBloggers = $model.weblog.getBookmarkFolder("/fellowBloggers"))
      #showBookmarkLinksList($fellowBloggers false false)
    </div>
  

Lines 1 and 5 simply set up a containing div to hold the list section. I've given it an appropriate id and class name for styling. Line 2 displays a header for the section.

The important stuff comes from lines 3 and 4. Line 3 sets a variable which holds a reference to the bookmark folder you want to display. "/fellowBloggers" means that I want to display the bookmarks in my fellowBloggers folder. If you had your bookmarks nested deeper, you would walk down the directory path just like you would any other folder structure.

Line 4 will render your linklist as a ul structure. The variable $fellowBloggers used in like 4 should match that defined in line 3. The ul element will have a class of rFolder and the list items will have a class of rFolderItem. Use these classes for CSS styleing. If you need seperate styleing for your lists, nest them in a container element with an ID and take advantage of inheritance in your stylesheets. If you need help with styling your lists, Mark Newhouse at a List Apart had written an extraordinary article; Taming Lists with CSS.

Adding Additional Category Lists

As you know, your blog posts can be sorted by categories.  Categories can be organized in the same fashion as bookmarks.  Likewise, they are rendered via your template in a similar fashion.  This example displays a list of categories in the root of your category folder.

    <div id="categories" class="sidebarbox">
       <h4>Categories</h4>
       #set($rootCategory = $model.weblog.getWeblogCategory("nil"))
       #showWeblogCategoryLinksList($rootCategory false false)
    </div>
  

The only differences are the getWeblogCategory function on line 3 and the showWeblogCategoryLinksList on line 4. You can use this method to display multiple lists of categories.

Other Menu Macros

Main Page Menu

  
    <div id="NavBar">
      #showPageMenu($model.weblog)
    </div>
  

This renders the primary menu for your blog. It will contain USD Blog Server, Weblog, Login, and others when logged in. The ul rendered by this macro will have the class rNavigationBar and the list item elements will have the class rNavItem. These can be used by your stylesheet to apply styles to your menu.

Feeds List

Your feeds are ATOM or XML documents that allow feed readers to read portions of your blog without visiting the site. An example of a feed reader can be found on the Lommen Health Science Website. Their feed reader syndicates posts to their blog on a separate website. Details on how to do this will come in a later post.

You can display you feed list with the following macro example:

  
    <div id="feeds" class="sidebarbox">
      <h4>Feeds</h4>
      #showAtomFeedsList($model.weblog)
    </div>
  

The ul element of your feed list will have the class rFeeds and your list item elements will not have a class, but you can use style inheritance to style them anyways.

Comments:

Post a Comment:
  • HTML Syntax: Allowed

Calendar

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by The University of South Dakota.