Books Overview

by Luke Simpson, Justin Bodeutsch | Last edited: 3/15/2012

The books module supports the following:

  • ability for user creation of "lists of books"
  • each book item has the following fields:
    • title
    • author
    • image (full size + thumbnail)
    • keywords
    • an affiliate URL (with amazon or another bookstore) for purchasing
    • category

Implementation Overview

Books make use of "display monklets" much like galleries and blogs. Only one monklet is needed to handle playlist lists, playlist detail, and book detail screens. There is a global monklet titled 'All Booklists' that will be used by detail to display books on sites.

1. Set the monklet

It is a good idea to copy the global monklet as they are likely to change in the future and cannot be relied upon. Save the copy as the default books monklet for the site.

If you are using categories for books you may want to add the following lines:

   groupby="category"
   group_show_books="<h6>__booktitle__</h6>"
Otherwise make sure those line are not present as no books will be shown if they are not assigned to a category.

2. Add Content

  1. Add booklists
  2. Add books
  3. Assign the books to the booklist with the content menus

3. Add the monklet to any page

Simply adding this monklet to any page will display a list of booklists on that page. Links will be auto-generated to the booklist detail / books list and book detail pages.

See the main monklet article to learn how to add monklets to pages.

Books API

For more detailed information about the API available for the Books module: Books API.

 

Examples

This would outout a list of authors assigned to all books in a booklist. This assumes that $booklist is set to the name of a booklist. Set $booklist to 'all' to see authors from all books.

getContent( 
"books", 
"display:list", 
"order:title", 
"groupby:author", 
"find_booklist:" . $booklist, 
"group_show_books:__booktitle__" 
);