[Zope] Re: Zope External Editor for other folderish containers
Jim Washington
jwashin@vt.edu
Fri, 24 May 2002 13:34:34 -0400
Casey Duncan wrote:
>On Friday 24 May 2002 11:58 am, Jim Washington wrote:
>[snip old stuff]
>
>
>>Hi, Casey
>>
>>This is a Truly Masterful Product! Thanks!
>>
>>I've done some work to make it work (for me) in other places, and it
>>appears that the link code:
>>
>> <dtml-let explicit="_.getitem('sequence-item').aq_explicit">
>> <dtml-if expr="_.hasattr(explicit, 'manage_FTPget')
>> or _.hasattr(explicit, 'read')
>> or _.hasattr(explicit, 'document_src')">
>> <a href="&dtml-URL1;/externalEdit_/&dtml.url_quote-sequence-key;"
>> 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>
>>
>>will be reused over and over.
>>
>>I was wondering whether you might consider in the future factoring the
>>link code into a separate DTML method so that it can be obtained by
>>acquisition. That way, the code would reside once in e.g.,
>>ObjectManager; and then OrderedFolder, FindSupport, etc. could acquire
>>it by using e.g., <dtml-var external_editor_link> instead of a full copy
>>of the link code.
>>
>>
>
>This sounds like a pretty good idea. I'll do this in the next release.
>
>Thanks for the suggestions!
>
>-Casey
>
>
And one always finds a problem right after publishing, right?
The link calculation needs to be something like
<a href= "<dtml-var
expr="explicit.absolute_url()[:explicit.absolute_url().rfind('/')]">/externalEdit_/<dtml-var
expr="explicit.getId()">"
if you want it to work everywhere in FindSupport. URL1 is relative to
the folder you are finding from, and the link needs to be where the
object is.
-- Jim Washington