Media API

by Justin Bodeutsch | Last edited: 4/15/2019

 

Display mode: list

before_show, after_show

Here are the tags available to before_show in the job list:

Tag Description
__pagination__ Show Pagination

 

Show

show
Tag Description
__id__ The ID of the media item
__name__ The name given to the media item
__slug__ The slug of the media item
__filename__ The filename of the media item
__url__ The public URL of the file
__externalurl__ The external URL of the item
__embed__ The embed code of the item.
__embedurl__ The url for the embeded item.
__id__ The internal ID number given to the item
__image__ A thumbnail version of the image (if an image)
__imageurl__ The url for the image (if an image)
__description__ The description of the media item
__category__ A comma seperated list of this media items categories
__tags__ Comma separated list of tags (keywords)

Parameters

find_parent_category

Will return all records assigned directly to the parent OR to any of its children.

Example:

"find_parent_category:parent-category",

 

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",

hide_category

Will not show items assigned to that category.

Example:

"hide_category:category-slug,category-slug2",

find_tag

Finds all items with that tag or tags. Spaces in tags should be replaced with a dash (-).

Example:

"find_tag:tag-slug,tag-slug2",

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.

item description
recent or modified 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. Can be used Independently(image), or with a comma separated list(image, video)

item description
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
Tag Description
__id__ The ID of the media item
__name__ The name given to the media item
__slug__ The slug of the media item
__filename__ The filename of the media item
__url__ The public URL of the file
__externalurl__ The external URL of the item
__embed__ The embed code of the item.
__embedurl__ The url for the embeded item.
__id__ The internal ID number given to the item
__image__ A thumbnail version of the image (if an image)
__imageurl__ The url for the image (if an image)
__description__ The description of the media item
__category__ A comma seperated list of this media items categories
__tags__ Comma separated list of tags (keywords)

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" />"
);