Functions/get collections

Description

The get_collections() helper returns the set of Collection records corresponding to the criteria given by $params.

Usage

<?php
 
get_collections($params = array(), $limit = 10);
 
?>

Arguments

  • params - An array of parameters. Available parameters include:
  • limit - The maximum number of collections you want to return. The default value is '10'.

Example

Listing the Names of Collections

This example should work on any page of your Omeka site. After getting collections, each collection is looped in a foreach statement and its name and description are printed to the screen.

<?php
 
$collections = get_collections();
 
foreach ($collections as $collection) {
	echo '<h2>' . $collection->name . '</h2>';
	echo '<p>' . $collection->description . '</p>';
}
 
?>

Source File

  • /applications/helpers/CollectionFunctions.php in Omeka 1.0.