You are here

public function GeolocationStyleBase::getTitleField in Geolocation Field 8.3

Get title value if present.

Parameters

\Drupal\views\ResultRow $row: Result Row.

Return value

string|null Title.

1 call to GeolocationStyleBase::getTitleField()
GeolocationStyleBase::getLocationsFromRow in src/Plugin/views/style/GeolocationStyleBase.php
Render array from views result row.

File

src/Plugin/views/style/GeolocationStyleBase.php, line 363

Class

GeolocationStyleBase
Geolocation Style Base.

Namespace

Drupal\geolocation\Plugin\views\style

Code

public function getTitleField(ResultRow $row) : ?string {
  if (!empty($this->options['title_field']) && $this->options['title_field'] != 'none') {
    $title_field = $this->options['title_field'];
    if (!empty($this->rendered_fields[$row->index][$title_field])) {
      return PlainTextOutput::renderFromHtml($this->rendered_fields[$row->index][$title_field]);
    }
    elseif (!empty($this->view->field[$title_field])) {
      return PlainTextOutput::renderFromHtml($this->view->field[$title_field]
        ->render($row));
    }
  }
  return NULL;
}