Media API

by Justin Bodeutsch | Last edited: 1/13/2014

 

Display mode: list

Show

show
TagDescription
__name__ The name given to the record
__filename__ The filename
__url__ The public URL of the file
__externalurl__ The external URL of the item
__embed__ The embed code of the item.
__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",

offset

Skips the first X records returned

Example:

"offset:1",

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
__name__ title of the item
__id__ id of the item
__slug__ slug of the item title
__description__ description of the item
__url__ url of the item
__imageurl__ url of the item (if an 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" />"
);