[ic] Filter sub routine not called

Ton Verhagen interchange-users@interchange.redhat.com
Tue Jan 29 04:48:00 2002


At 09:53 AM 1/29/02 +0100, Alexandra Birch <alexandra@trymedia.com> wrote:
> > That is not how to add a filter. It will be easier in the
> > next version of Interchange, but for now a user cannot
> > add filters in catalog.cfg.
> >
> > I think the "textarea_put" filter would do what you want.
>
>How can I add filters without touching the interchange libraries?
>The Docs said I should create a Sub or GlobalSub but where do I put it?.
>Textarea_put wont do. I need to create a filter that leaves html tags 
>alone but converts IC tags.

Alexandra,

I got this in interchange.cfg:

GlobalSub <<EOF
sub set_up_extra_filters {
   BEGIN {
     package Vend::Interpolate;

     $Filter{reverse} = sub { my $val = shift; return scalar reverse $val;  };
   }
}
EOF

To see the effect go to: http://www.verhagen.net/cgi-bin/tools/reverse

Note:
You have to restart the Interchange server after you've put the above code 
in the interchange.cfg file.

Hope this helps.


Best
         Ton

--
Alamerce Nederland --- Cornerstone of eBusiness

eCommerce Solutions, Interactive Websites and Website Hosting
Url: http://www.alamerce.nl; Email: info@alamerce.nl; Phone +31-40-2374381