[Zope] Re: Feature I would like to see in next ReplaceSupport

Casey Duncan casey@zope.com
Thu, 12 Sep 2002 14:14:27 -0400


The current release (0.5) patches the general Zope find results page (tha=
nks=20
to Jim Washington). The general way to add a link (in dtml) to your own=20
template that discovers whether external editor is available would be:

<dtml-if externalEdit_>
  <dtml-var expr=3D"externalEditLink_(this())">
</dtml-if>

This assumes version 0.5 or better.

-Casey

On Thursday 12 September 2002 12:50 pm, Peter Bengtsson wrote:
> Stefan,
>=20
> When you get a search result using the ReplaceSupport product I think i=
t=20
> would be great if next to every link there's a little ExternalEditor pe=
n=20
> for the ExternalEditor product for those who have that installed.
>=20
> I tried quickly and it works but I'm not sure how good it is.
> What I tried was this,  around line 80 in dtml/replaceResults.dtml
>=20
>     <!-- Peter addition -->
>    <dtml-let explicit=3D"_.getitem('sequence-item').aq_explicit"
>          parent_url=3D"explicit.aq_parent.absolute_url()">
>      <dtml-if expr=3D"_.hasattr(explicit, 'manage_FTPget')
>                     or _.hasattr(explicit, 'read')
>                     or _.hasattr(explicit, 'document_src')">
>        <a href=3D"&dtml-parent_url;/externalEdit_/<dtml-var=20
"explicit.getId()">"
>           title=3D"Edit using external editor"
>        ><img src=3D"&dtml-BASEPATH1;/misc_/ExternalEditor/edit_icon"
>              align=3D"middle" hspace=3D"2" border=3D"0" alt=3D"External=
 Editor"=20
/></a>
>      </dtml-if>
>    </dtml-let>
>    <dtml-if locked_in_version>
>      <dtml-if modified_in_version>
>        <img src=3D"&dtml-BASEPATH1;/p_/locked"
>         alt=3D"This item has been modified in this version" />
>      <dtml-else>
>        <img src=3D"&dtml-BASEPATH1;/p_/lockedo"
>         alt=3D"This item has been modified in another version" />
>         (<em>&dtml-locked_in_version;</em>)
>      </dtml-if>
>    </dtml-if>
>     <!-- / Peter addition -->
>=20
>=20
> In my product QuickLinks (http://www.zope.org/Members/peterbe/QuickLink=
s) I=20
> override the same stuff as ExternalEditor does if you wanna see how I m=
ade=20
> the distinction between having and not having ExternalEditor installed
>=20