mysite_display

Definition

mysite_display($type, $type_id, $uid = 0, $format = 'default')
mysite.module, line 1207

Description

Display a MySite content element outside of the MySite page

Parameters

$type A string indicating the content type

$type_id The content id (such as term id) to retrieve

$uid The user account to retrieve MySite page settings for. Optional.

$format The name of the MySite format plugin to use for output. Optional.

Return value

A themed HTML element ready for display, or a message on failure.

Code

function mysite_display($type, $type_id, $uid = 0, $format = 'default') {
  $data = mysite_render($type, $type_id, $uid);
  if ($data) {
    // load the format file
    mysite_load_includes('formats', $format);
    // call the correct theme function
    $func = 'mysite_'. $format .'_item';
    $output = theme($func, $data['items']);
  }
  else {
    $output = t('The requested content failed to load.');
  }
  return $output;
}