Hi, I have an issue with Format Show as Content:Teaser inside of view.
When I use Content:Teaser I can't include the class on a div wrapper as supposted.
What is the procedure for targeting the isotope filter then?

I need to use the format show as teaser so I can include taxonomy image.

CommentFileSizeAuthor
#2 Isotope filter.PNG216.74 KBmads-thines
#2 isotope.PNG24.26 KBmads-thines

Comments

madsthines created an issue. See original summary.

mads-thines’s picture

StatusFileSize
new24.26 KB
new216.74 KB

I've found a solution

If anyone is interested in the isotope function with usage of a taxonomy image.

- The problem -

In views I have selected taxonomy term with the a .isotope-filter added as CSS classes so the function know which target it is.
I wanted to show the taxonomy image and this is where the problem occurred. Instead of plain text I selected image under the "Formatter" but then isotope sort function stopped working. If you look at Image 1 the green bubble in the top is the taxonomy image.

- The solution -

I added a second taxonomy term in the views fields and changed it plain text so that the .isotope-filter works and then just hid it by CSS. The HTML and javascript can find the .isotope-filter and execute the function as a plain text format, but still has the appearance which of the taxonomy image.

(SEE IMAGE FOR BETTER UNDERSTANDING)

Good day folks!

MT.

mads-thines’s picture

Status: Active » Fixed
Reuben Unruh’s picture

This also works for 7.x-2.0-alpha1 by adding a new formatter for taxonomy terms to the manage display page. Put this code in views_isotope.module or in your own custom module (replace views_isotope with your module name at the beginning of each function).

/**
 * Implements hook_field_formatter_info().
 */
function views_isotope_field_formatter_info() {
  return array(
    'taxonomy_term_reference_isotope_filter' => array(
      'label' => t('Isotope filter'),
      'field types' => array('taxonomy_term_reference'),
    ),
  );
}

/**
 * Implements hook_field_formatter_view().
 */
function views_isotope_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'taxonomy_term_reference_isotope_filter':
      foreach ($items as $delta => $item) {
        $item['taxonomy_term'] = taxonomy_term_load($item['tid']);
        $name = $item['taxonomy_term']->name;
        $element[$delta] = array(
          '#markup' => '<div class="isotope-filter">' . ($name) . '</div>',
        );
      }
    break;
  }
  return $element;
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.