[Framework-Team] Re: Base tag

Laurence Rowe l at lrowe.co.uk
Sun Mar 11 17:38:43 UTC 2007

Martin Aspeli wrote:
> Geir Bækholt · Plone Solutions wrote:
>> On 9. mar. 2007, at 17.22, Laurence Rowe wrote:
>>>> I would vote for keeping the base tag anyway, as it would make the  
>>>> site not break if someone makes a wrong link somewhere.
>>>> Another possibility to help this would be to make all folderish  
>>>> content redirect to get the trailing slash, like Apache does.
>>> +1 on redirecting
>>> Historically the Zope mantra has been to return data rather than  
>>> redirect to save the overhead of processing an extra request. Plone  
>>> is a complex application and I suspect this overhead is negligible  
>>> compared to rendering a page. Matching Apache's behaviour would  make 
>>> things conceptually simpler.
>>> INonStructuralFolders should probably not have a trailing slash  
>>> appended.
>> If INonStructuralFolders don't redirect and don't have base tags,  
>> relative links to the objects contained in them may easily break.  
>> They exhibit the exact same behavior as normal folders…
> Yes. An INonStructuralFolder should be treated exactly the same as a 
> real folder; the interface pertains to the Plone UI only. 
> isPrincipiaFolderish should be the only thing we check.
> Martin

Hmm, I'm not convinced by this. Take a RichDocument for instance. The 
rich text field is on the RichDocument object itself. So we're either 
going to end up with:

   a) treating it like a document:

      Relative links in the rich text field to external/sibling images 
work like other documents.

      Relative links to contained images don't work

   b) treating it like a folder:

      Relative links in the rich text field end up with an acquired 
image (multiple copies get cached) or lead to a page outside the normal 
containment hierarchy.

      Relative links to contained images and files work fine.

So either way some things don't work as expected. I think this is a UI 
question, should URLs to RichDocuments end with a trailing slash? In my 
view no as for a RichDocument "It has every method and attribute of the 
standard Page/Document type. That is, it can be used as a drop-in 
replacement wherever a Page is expected."

Having said that it would seem easier to change the way Zope handles 
this and catch it during traversal, where checking isPrincipiaFolderish 
would seem the correct thing to do.


More information about the Framework-Team mailing list