function theme_isotope_sorter in Views Isotope (Deprecated) 7.2
Default theme implementation for the sorting list.
Parameters
array $vars: Variables for theming.
Return value
string Markup.
2 theme calls to theme_isotope_sorter()
- template_preprocess_views_isotope_views_sorter in views/
views_isotope_views.theme.inc - Preprocess function for isotope sort blocks.
- views_isotope_example_theme_page in views_isotope_example/
views_isotope_example.module - Page callback.
File
- ./
views_isotope.module, line 546 - Load the isotope library and provide configuration and theme options.
Code
function theme_isotope_sorter(array $vars) {
$attributes['class'] = 'isotope-options sorts clearfix';
if (!empty($vars['instance'])) {
$attributes['data-instance-id'] = 'isotope-instance-' . $vars['instance'];
}
if (!empty($vars['original'])) {
$vars['sorts'] = array(
$vars['original'] => 'original-order',
) + $vars['sorts'];
}
foreach ($vars['sorts'] as $key => $value) {
$sort = is_array($value) ? implode(',', $value) : $value;
$label = empty($key) || is_numeric($key) ? $sort : $key;
$items[] = l($label, '', array(
'attributes' => array(
'class' => 'sorterbutton',
'data-sort-by' => $sort,
),
'fragment' => 'sorter',
'external' => TRUE,
'html' => TRUE,
));
}
$return = array(
'#theme' => 'item_list',
'#items' => $items,
'#type' => 'ul',
'#title' => t('Sort By'),
'#attributes' => $attributes,
);
return drupal_render($return);
}