You are here:  » textarea instead of textfield for products ?

Support Forum



textarea instead of textfield for products ?

Submitted by alecs on Thu, 2009-07-30 08:40 in

hi david,

is it possible to change the textfield for filters to a textarea ?
row based like the cat. mapping ?
got a lot of categories id like to drop and this kind of work takes
a lot of time for me. maybe something like that ...

klick example

Submitted by support on Thu, 2009-07-30 08:53

Hello Alecs,

Sure - the text field for the Drop Record filter is generated by this code on line 139 of includes/filter.php

    print "<input type='text' size='40' name='text' value='".widget_safe($filter_data["text"])."' />";

To change this to a text area, replace this line with:

    print "<textarea type='text' rows='10' cols='50' name='text'>".widget_safe($filter_data["text"])."</textarea>";

If you want to make a similar change to the Drop Record If Not RegExp - perhaps more likely if you are wanting to filter out lots of categories, it's exactly the same modification but to line 178.

However, the new-line characters in both places may cause problems. If this happens, look for the corresponding filter exec function - in the case of Drop Record (If Not) is is just below the above line, beginning:

  function filter_dropRecordIfNotRegExpExec($filter_data,$text)
  {

...and at the first line of the function, add the following code

  $filter_data["text"] = str_replace("\n","",$filter_data["text"]);
  $filter_data["text"] = str_replace("\r","",$filter_data["text"]);

Hope this helps!

Cheers,
David.