function tripal_get_title_format

3.x tripal.entities.api.inc tripal_get_title_format($bundle)

Get Page Title Format for a given Tripal Entity Type.

Parameters

TripalBundle $bundle: The Entity object for the Tripal Bundle the title format is for.

Related topics

2 calls to tripal_get_title_format()
TripalEntityController::setTitle in tripal/includes/TripalEntityController.inc
Sets the title for an entity.
tripal_tripal_bundle_form in tripal/includes/TripalBundleUIController.inc
Tripal content type edit form.

File

tripal/api/tripal.entities.api.inc, line 918
Provides an application programming interface (API) for working with TripalEntity content types (bundles) and their entities.

Code

function tripal_get_title_format($bundle) {

  // Get the existing title format if it exists.
  $title_format = tripal_get_bundle_variable('title_format', $bundle->id);

  // If there isn't yet a title format for this bundle/type then we should
  // determine the default.
  if (!$title_format) {
    $title_format = tripal_get_default_title_format($bundle);
    tripal_save_title_format($bundle, $title_format);
  }

  return $title_format;
}