You are here:  » Add column showing content of filters in the backend


Add column showing content of filters in the backend

Submitted by KennethJ on Thu, 2015-07-30 16:52 in

Hi David,

I have one more request and I hope you have the time to help me out.

On the admin side on feed_filters.php (both global filters and filters per feed) I would like to add a column showing the actual content of the filter. This would strongly improve the administrative work of setting up filters because you easy get an overview of the applied filters.

Is this possible?

Thanks,
Ken

Submitted by support on Thu, 2015-07-30 17:00

Hello Ken,

Sure - there is a clean output of filter configuration displayed within the Filters page (per feed or Global) described in this thread...

In summary, in admin/feeds_filters.php, look for the following code at line 149:

      print "<td>".$fields[$filter["field"]]."</td>";

...and REPLACE with:

      print "<td>".$fields[$filter["field"]]."</td>";
      print "<td>";
      $data = unserialize($filter["data"]);
      if (is_array($data))
      {
        foreach($data as $k => $v)
        {
          print "<strong>".$k."</strong>: ".$v."<br />";
        }
      }
      print "</td>";

Cheers,
David.
--
PriceTapestry.com

Submitted by KennethJ on Thu, 2015-07-30 17:38

I love it!

Thanks,
Ken

Submitted by 2fer on Sat, 2015-10-03 17:35

Hi David,
I ran into this answer while looking for something else. I tried to follow, but I see that the older thread referred to is from 2010 and this new one must be for a newer version than mine. Is there a similar fix for the v.13a? It would help a lot to be able to weed out unused filters when feeds come in differently (product name weirdness, category rewrites). Some feeds have many filters and it can be hard to even open up each one to make an adjustment. It would help immensely to get an idea of what is in a filter that was added 2 years ago without needing to click each one.

No rush, when you find time.
Thank you!
2fer

Submitted by support on Sun, 2015-10-04 09:42

Hello 2fer,

The same replacement should work fine in 13/03A, the original code to look for is at line 97 in admin/feeds_filters_configure.php:

      print "<td>".$fields[$filter["field"]]."</td>";

...REPLACE with:

      print "<td>".$fields[$filter["field"]]."</td>";
      print "<td>";
      $data = unserialize($filter["data"]);
      if (is_array($data))
      {
        foreach($data as $k => $v)
        {
          print "<strong>".$k."</strong>: ".$v."<br />";
        }
      }
      print "</td>";

Cheers,
David.
--
PriceTapestry.com

Submitted by 2fer on Mon, 2015-10-05 18:13

Thank you so much David!
I'll get that done today. It should speed editing, much appreciated!
2fer