[Zope] Filtering Content

Jeff Ross thejeffross@hotmail.com
Mon, 8 Apr 2002 12:53:54 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_001B_01C1DEFC.708D0720
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am looking for a way to filter out <IMG> tags from a Zope site. I'm =
using Zope 2.5.0 + CMF + CMFWiki. I have managed to modify the render =
routine of CMFWikiPage, but the request argument is empty, so I can't =
check to see if a cookie has been set.

What I want to do is examine a cookie called TextOnly. If the value is =
1, then the filter will replace all the Image tags with the ALT text. =
Otherwise, the filter will not be called.

As the code stands now, it's only modifying the contents of CMFWiki =
pages, leaving the outer framework of the site intact. What I want is to =
replace ALL image tags, so I need to get at something higher-level, like =
the entire HTML text just before it gets sent back to the browser.

Jeff


------=_NextPart_000_001B_01C1DEFC.708D0720
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am looking for a way to filter out =
&lt;IMG&gt;=20
tags from a Zope site. I'm using Zope 2.5.0 + CMF + CMFWiki. I have =
managed to=20
modify the render routine of CMFWikiPage, but the request argument is =
empty, so=20
I can't check to see if a cookie has been set.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What I want to do is examine a cookie =
called=20
TextOnly. If the value is 1, then the filter will replace all the Image =
tags=20
with the ALT text. Otherwise, the filter will not be =
called.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>As the code stands now, it's only =
modifying the=20
contents of CMFWiki pages, leaving the outer framework of the site =
intact. What=20
I want is to replace ALL image tags, so I need to get at something =
higher-level,=20
like the entire HTML text just before it gets sent back to the=20
browser.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jeff</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_001B_01C1DEFC.708D0720--