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

Jim Washington jwashin@vt.edu
Thu, 12 Sep 2002 13:54:50 -0400


Peter Bengtsson wrote:

> Stefan,
>
> When you get a search result using the ReplaceSupport product I think 
> it would be great if next to every link there's a little 
> ExternalEditor pen for the ExternalEditor product for those who have 
> that installed.
>
> 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
>
>    <!-- Peter addition -->
>   <dtml-let explicit="_.getitem('sequence-item').aq_explicit"
>         parent_url="explicit.aq_parent.absolute_url()">
>     <dtml-if expr="_.hasattr(explicit, 'manage_FTPget')
>                    or _.hasattr(explicit, 'read')
>                    or _.hasattr(explicit, 'document_src')">
>       <a href="&dtml-parent_url;/externalEdit_/<dtml-var 
> "explicit.getId()">"
>          title="Edit using external editor"
>       ><img src="&dtml-BASEPATH1;/misc_/ExternalEditor/edit_icon"
>             align="middle" hspace="2" border="0" alt="External Editor" 
> /></a>
>     </dtml-if>
>   </dtml-let>
>   <dtml-if locked_in_version>
>     <dtml-if modified_in_version>
>       <img src="&dtml-BASEPATH1;/p_/locked"
>        alt="This item has been modified in this version" />
>     <dtml-else>
>       <img src="&dtml-BASEPATH1;/p_/lockedo"
>        alt="This item has been modified in another version" />
>        (<em>&dtml-locked_in_version;</em>)
>     </dtml-if>
>   </dtml-if>
>    <!-- / Peter addition -->
>
>
> In my product QuickLinks 
> (http://www.zope.org/Members/peterbe/QuickLinks) I override the same 
> stuff as ExternalEditor does if you wanna see how I made the 
> distinction between having and not having ExternalEditor installed

With the current version of ExternalEditor, you can save about nine 
lines and simply put

<dtml-var expr="externalEditLink_(this())">

for each item.

-- Jim Washington