Media API

by Justin Bodeutsch | Last edited: 8/5/2011

 

Display mode: list

Show

show
TagDescription
__name__
The name given to the record
__filename__ The filename
__id__ The internal ID number given to the item
__image__ A thumbnail version of the image (if an image)
__description__ The description of the media item
__tags__ Comma separated list of tags (keywords)

Parameters

howmany

Sets the maximum number of items to display

Example:

"howmany:3",

order

Sets sort order of items in list. By default will show the oldest items first.

itemdescription
recent by date, starting with most recent
random returns a random list
title by title, in alphabetical order
type

Sets which types of files to display.

itemdescription
image jpg,gif,png,bmp
audio mp3,wav,aiff
video wmv,mpeg,mp4,mpg,mov,avi,m4v,flv
document All other file types are labeled document

Display mode: detail

Show

show
TagDescription
__description__
The description of the media item
__imageurl__
url of the image
__name__ title of the image

Parameters

find

Slug of a media item or nav slug ($_GET['nav']) if used in conjunction with label:header.

label:header

Grabs the header image for records that support header images (pages, blogs, etc.).

Examples

getContent(
  "media",
  "display:list",
  "type:image",
  "howmany:10",
  "order:random",
  "show:__name__ -- __filename__<br>"
);

getContent(
      "media",
      "display:detail",
      "find:".$_GET['nav'],
      "label:header",
      "show:<img src="__imageurl__" alt="__name__" id="subpage_header" />"
);