question about customizing file view behavior

4 messages Options
Embed this post
Permalink
David Hostetler () question about customizing file view behavior
Reply Threaded More More options
Print post
Permalink
I have been asked to enable the following behavior:

- file items in a folder listing should be linked to using the default view (i.e. not '/view'), so that if they are, say, a PDF, the browser's PDF plugin gets invoked and is file is viewed directly.

Ok, that's easily accomplished by just removing File from the 'typesUseViewActionInListings' list in portal_properties/site_properties.

However -- content authors have now lost the only easy means with which to access the '/view' template for file items, making it cumbersome and arcane to edit file items, because they never see the view that offers them the 'edit' action tab.  Basically, they have to know that they can manually append '/view' or '/edit' to the item's URL to get to those screens.

My thought was to customize the folder_contents view so that it always offered up the '/view' URL for file items.  So when an author wants to edit or manage a file item, they click 'contents' for its parent folder, and then just click the item in that listing.  In other words -- the folder_contents view provides a more administratively-minded listing of the folder's contents (which it already does by allowing reordering, copy-n-paste, etc..).

Since folder_contents uses the same typesUseViewActionInListings list as the other folder templates, I either have to:

a) create a customized version of folder_contents that uses a different site_property list (something like 'typesUseViewActionInContentListings'), and create that property and populate it with at least 'File'.

OR

b) customize every other known view of folders to _NOT_ use typesUseViewActionInListings for File items, and instead always indiscriminately use the default view URL for files.


(a) seems like the cleaner approach, but I wanted to solicit opinions on whether I'm thinking of this correctly.  Maybe there's a silly simple way to get what I want without the trouble of a full custom version of the folder_contents view (which is pretty heavy-weight, and I'd basically be touching one line in a mirrored version of plone/app/content/browser/foldercontents.py).

Thanks in advance for any advice/help.


-hoss

David Hostetler
[hidden email]

_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Sergey V. () Re: [Plone-developers] question about customizing file view behavior
Reply Threaded More More options
Print post
Permalink
The correct option is a), and it's ~ 5 minutes work. Actually, I'd just hard-code this in the template - you could even have [open] [download] [edit] links next to each file

Now run before they caught you for cross-posting to two lists both of which are not related to the question :)

Since folder_contents uses the same typesUseViewActionInListings list as the other folder templates, I either have to:

a) create a customized version of folder_contents that uses a different site_property list (something like 'typesUseViewActionInContentListings'), and create that property and populate it with at least 'File'.

OR

b) customize every other known view of folders to _NOT_ use typesUseViewActionInListings for File items, and instead always indiscriminately use the default view URL for files.



--
Sergey Volobuev

_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
David Hostetler () Re: [Plone-developers] question about customizing file view behavior
Reply Threaded More More options
Print post
Permalink
Roger that.  Thanks!

For future reference, what list should this have gone to?  This issue came up in the course of developing products (I'm doing a policy product and multiple theme products), and touches on what seems like a little hole in the UI-friendliness of file item administration for default plone behavior.  Should it have gone to plone-users?

Now I'm off to no doubt spend several hours doing '~5 minutes' worth of plone customization.  :)

-hoss


On Wed, Aug 19, 2009 at 16:29, Sergey Volobuev <[hidden email]> wrote:
The correct option is a), and it's ~ 5 minutes work. Actually, I'd just hard-code this in the template - you could even have [open] [download] [edit] links next to each file

Now run before they caught you for cross-posting to two lists both of which are not related to the question :)


Since folder_contents uses the same typesUseViewActionInListings list as the other folder templates, I either have to:

a) create a customized version of folder_contents that uses a different site_property list (something like 'typesUseViewActionInContentListings'), and create that property and populate it with at least 'File'.

OR

b) customize every other known view of folders to _NOT_ use typesUseViewActionInListings for File items, and instead always indiscriminately use the default view URL for files.



--
Sergey Volobuev


_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Wouter Vanden Hove-2 () Re: question about customizing file view behavior
Reply Threaded More More options
Print post
Permalink
In reply to this post by David Hostetler

correct answer IMHO

 - create an alternative for file_view ("redirect_view")
 that redirects to the file itself instead of showing a page
with a download-link.

There is an analogue situation with the Link-type
explained here:
http://plone.org/documentation/how-to/repurpose-link-object

The Link-type is now fully fixed, but not the file_view,
For intranet-use the file-view is annoying for many users.

--
Greets,
WouterVH


_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers