plugin('translate');
$url = $this->plugin('url');
$api = $this->plugin('api');
$siteSlug = $site->slug();
$hyperlink = $this->plugin('hyperlink');
$references = $this->plugin('references');
$totals = $references->count($fields, $query, $options);
$this->htmlElement('body')->appendAttribute('class', 'reference browse list');
?>
- searchOne('properties', ['term' => $field])->getContent() ?: $api->searchOne('resource_classes', ['term' => $field])->getContent();
$total = $totals[$field];
echo $hyperlink(
sprintf($translate('%s (%d)'), $element->label(), $total),
// TODO Define the link to the reference page.
$url('site/page', ['site-slug' => $siteSlug, 'page-slug' => str_replace(':', '-', $field)]),
['title' => sprintf($translate('Browse %s'), $element->label())]
);
else:
$element = $api->searchOne('properties', ['term' => $field])->getContent() ?: $api->searchOne('resource_classes', ['term' => $field])->getContent();
$total = $totals[$field];
echo $hyperlink(
$element->label(),
// TODO Define the link to the reference page.
$url('site/page', ['site-slug' => $siteSlug, 'page-slug' => str_replace(':', '-', $field)]),
['title' => sprintf($translate('Browse %s'), $element->label())]
);
endif;
?>