Books API

Last edited: 9/19/2013

Display Mode: Auto

Depending on the URL, auto will either produce a list of booklists, a list of books for a particular list or a single book. See the book overview page for more information on this.

Display Mode: List

Depending on the parameters of the monklet or getContent, 'list' will produce either a list of booklists or a list of books. See the book overview page for more information on this.

Parameters

All parameters apply to the booklist detail page unless noted.

find_booklist

Only for display:list, will display a list of books for that booklist.

Example:

"find_booklist:booklist-title-slug",

find_book

Find a specific book.

Example:

"find_book:book-slug",

find_author

Find a specific author. Use the natural author name, not a slug version of it.

"find_author:Some Author",

howmany

Sets the maximum number of items to display

Example:

"howmany:3",

offset

Skips the first X records returned

Example:

"offset:1",

 

find_category

Only show items assigned to that category. Can find multiple categories with a comma separated list. If category slugs are separated by , or || any item assigned to ANY specified category is returned. If && is used to separate only items assigned to ALL specified categories will be returned.

Example:

"find_category:category1,category2,category3",

"find_category:category1 && category2 && category3",

order

Sets sort order of items in list

itemdescription
recent by date, starting with most recent
title by entry title, alphabetically
groupby

Sets a criteria to group the list by. This will produce an unordered list (<ul>) with the relevant titles as the list items (<li>). With recent, it will show the last 5 entries (can be changed with "howmany").

Available grouping criteria:

  • category
  • author

Example:

"groupby:category",

URL Parameters 

All URL based parameters require display:auto

http://www.example.com/booklist-slug/book-slug/

This will display a detail page for a book. "show_detail" tags will be used.

http://www.example.com/booklist-slug/

This will display a list of books for the booklist. "before_show_books","show_books", and "group_show_books" tags will be used.

http://www.example.com/anything-other-than-a-booklist-slug/

On any other page a list of booklists will be shown. "show_booklist" and "before_show_booklist" tags will be used.

API

Booklists List 

If no booklist is specified in the URL or through "name", before_show_booklist and show_booklist tags are used.

before_show_booklist

There are no tags for before_show_booklist but it can be used to display messages above the list of booklists.

show_booklist
TagDescription
__booktitle__ Title of the Booklist
__bookdescription__ Description of the Booklist
__booktitlelink__ Produces booklist-slug/
Any Custom Fields setup for Booklists will output their API tags

Booklist Detail / Books List

If the URL or 'name' specifies a booklist, the following tags are available.

before_show_books, after_show_books
TagDescription
__booktitle__ Title of the Booklist
__bookdescription__ Description of the Booklist
__pagination__ Divides the records into smaller groups and provides links to navigate through them
Any Custom Fields setup for Booklists will output their API tags
group_show_books

Only used if groupby parameter is used.

TagDescription
__booktitle__ Displays the name of the grouped content
__bookdescription__ Displays the description of the grouped content
show_books
TagDescription
__booktitle__ The title of the book
__booktitlelink__ Produces book-slug/
__booktitleslug__ The slug of the book title
__bookauthor__ The author of the book
__bookcategory__ Comma separated list of books
__image__ URL of the image associated with the book
__imageurl__
__image2__
__imageurl3__
__image3__
__imageurl3__
__bookimageTMB__ URL of the thumbnail image associated with the book
__booktext__ Description of the book
__bookaffiliate__ Affiliate URL for the book
__bookkeywords__ Comma separated list of tags
__bookcommentnumber__ Outputs "Comments(5)"
__bookcommentnumberonly__ Outputs only a number.
__bookcommentlist__ Only for detail, outputs a list of comments and the form to add more.
Any Custom Fields setup for Books will output their API tags

Book Detail

If the URL specifies a booklist and a book the following tags are available.

show_detail
TagDescription
__booktitle__ The title of the book
__booktitlelink__ Produces book-slug/
__bookauthor__ The author of the book
__bookcategory__ Comma separated list of books
__image__ URL of the image associated with the book
__imageurl__
__image2__
__imageurl2__
__image3__
__imageurl3__
__bookimageTMB__ URL of the thumbnail image associated with the book
__booktext__ Description of the book
__bookaffiliate__ Affiliate URL for the book
__bookkeywords__ Comma separated list of tags
Any Custom Fields setup for Books will output their API tags

Display mode: categories

Show

level#
TagDescription
__bid__ Internal system ID of the category for unique identification.
__count__ Numerical count of the articles belonging directly to the category.
__level__ Hierarchical level of the category. The root level is considered level 1.
__name__ Name of the category as entered in the backend.
__parentid__ Internal system ID of the category's parent. This is set to '0' if the category has no parent.
__slug__ Slugged version of the category name.

Parameters

parent_category

Specifies the parent category slug to use as the hierarchical root to start from.

Example:

"parent_category:slugged-category-name",

Full Example

getContent(
   "MODULETYPE",
   "display:categories",
   "level1:Parent: __name__ (__count__) ",
   "level2:Child: __name__",
   "level3:Grandchild: __name__",
);