When I remember right, then "actions" have a
target property. This would allow you to control the target, when the link is generated by an "action", e.g. the "view action".
But, as far as I know there is no hook to control the
target attribute of generated
a elements (which controls in which window the link is presented) in general templates such as those for the navigation portlet and "folder_view". I see two options:
- You use customized templates for the "navigation portlet" and "folder_view".
- You use
diazo (Plone's XSLT based output transform stage) to add the attribute in the final transform stage.
When I remember right, then the Plone documentation covers the basics for both approaches.
I assume that you mean by this "different behavior for files with different MIME type". The "MIME type" describes in a formal way, which type of content the file contains: is it e.g. HTML or plain text, PDF or MS excel, ...
I recommend not to implement different behavipr for files with different MIME type. Plone does not directly support that and browsers typically do a good job to handle files appropriately based on their MIME type.
However, should you really need this, then Plone file objects give you the associated MIME type as an attribute (potentially called
content_type). In your implementation of the
@@display-file view, you can behave differently according to the MIME type of the respective object.
diazo stage, the transformation process has no longer access to Plone objects: all it has is the generated [X]HTML. Therefore, it lacks the possibility to do things differently based on the MIME type of referenced objects. However, you can still use the "customize template" option to achieve this.