You are here

function template_preprocess_date_display_single in Date 8

Same name and namespace in other branches
  1. 7.3 date.theme \template_preprocess_date_display_single()
  2. 7.2 date.theme \template_preprocess_date_display_single()

Template preprocess function for displaying a single date.

File

./date.theme, line 215
Theme functions.

Code

function template_preprocess_date_display_single(&$variables) {
  if ($variables['add_rdf']) {

    // Pass along the rdf mapping for this field, if any. Add some default rdf
    // attributes that will be used if not overridden by attributes passed in.
    $rdf_mapping = $variables['rdf_mapping'];
    $base_attributes = array(
      'property' => array(
        'dc:date',
      ),
      'datatype' => 'xsd:dateTime',
      'content' => $variables['dates']['value']['formatted_iso'],
    );
    $variables['attributes'] = $variables['attributes'] + $base_attributes;
  }
}