Views

Remove duplicate entries from views results... the hard way.

In some cases it is seems impossible to get rid of the duplicate entries that views return in the output.
Not an elegant way, but this small module would do the trick...

So let's create a module the usual way, and put the following code in the .module file.
This one is called remove_duplicates.

 
<?php
function remove_duplicates_views_pre_render(&$view)
{
  $used_nids = array();

          foreach ($view->result as $row)
      {
        if (!in_array($row->nid, $used_nids))
        {
          $new_view_result[] = $row;
          $used_nids[] = $row->nid;

Translate <Any> in Views Exposed Filter

While trying to translate the <Any> string in Views, locale returned the error "unsupported HTML".

A quick workaround is to switch from <Any> to -Any-; There is an option available under the Views Tools tab just for that.

The string "-Any-" is translatable, so from this point on it is easy to search for the string "-Any-" in locale search. If it is not found, you would probably need to check that you typed Any in the search form (case sensitive!).

Once found, it is easy to enter the required translation.

Syndicate content