General: Using Drupal 6.x for higher education/library consortium. Have hundred of documents to provide. Webfm set up and working fine from all appearances.
Question: Is it possible to link directly to a subdirectory of my file structure from a specific node and present that subdir within the webfm interface?
Background: I have a documentation portal currently running on a node/book format. I want to be able to link to the webfm subdirectory where we will provide all of the vendor documentation for support and reference. the path would be siteaddress/webfm/Directors/Librarians/Docs
In the webfm interface, if I type the full url path, it continues to show the full hierarchy and does not just link to the directory I'd like to point to. I have roles & permissions set accordingly, and have done a bunch of research on this.
I imagine that this is not possible due to the way that webfm works, but it would be nice to be able to do this so I could create pages/nodes/books that point directly to a specific directory within the webfm interface without the user having to know that they will need to browse to that directory to find what they need.
I know I can just attach the individual docs to that page, but that is what we have BEEN doing and I want the browsable functionality inherent in webfm so the user doesn't have to guess which directory the document is in like they do currently.
What am I missing/misunderstanding?
Your help and knowledge sharing is greatly appreciated. Thank you for your time and effort.
Comments
Comment #1
robmilne commentedI am about to add an example custom module that does something similar to what you want. It programmatically creates a list of files from a specified directory and can be easily modified to add any markup. A nice feature is the inherent webfm security.
Comment #2
InfoSciPhi commentedThat would be great. Thank you.
Comment #3
InfoSciPhi commentedIf anyone else has any suggestions I would be very thankful to hear them.
Comment #4
ianchan commented+1
Comment #5
ianchan commentedIs the custom module mentioned in #1 available at a different location?
Comment #6
robmilne commentedNo. It is packaged with the latest release inside the modules directory. The info file requires renaming to make it visible. It works out of the box but is really meant as guide for custom module development.
Comment #7
nhck commentedComment #8
stkrzysiak commentedThis is an interesting problem. I'm curious if anyone has succeeded doing this yet, as even though the webfm_example_listing module is great for displaying some inner workings of webfm and file links, it does not help much in regards to linking to a specific directory. There is a webfm_send_file that makes web_fm_send possible which makes that module 'go', but no webfm_load_directory or anything along that thought plane(from what I can see).
I'm not sure if this would be best handled using some sort of JS hack or a hack of the module itself. Actually, come to think of it, it should(and probably could) be done via custom module.
Any insight on this one is appreciated, of course, and I will update accordingly with what I get going on my end.
Comment #9
cgmonroe commentedGet the -dev version and look at the custom_layout function in this. With this you can create a page or block to go to a specific directory and a bunch of other GUI options related to this.
See: #736548: Patch to add support for custom layouts
Comment #10
stkrzysiak commentedWhoah, wow, thanks, looking into it now!
Comment #11
scott859 commentedGreetings,
I can see the custom_layout function in webfm.mudule, but am not clear on how to get this to work to show all files within a particular directory.
As an alternative, I also enabled the webfm_example_listing module as described in post #6. I did see a field to define a files directory, but it appears to be a site-side definition rather than an individual node based definition (unless I am seeing this wrong).
I'm trying to show files within a directory that is unique to a particular node. Different nodes can have their unique directories that I would like to show the file contents of.
If anyone has any insight into how to accomplish this, I would appreciate it.
Thanks in advance.
Comment #12
cgmonroe commentedI'm not sure exactly what you want to display here... Webfm organizes things into directories that people create. The only node relationship that happens is if the file is attached to a node... and those files can be located anywhere the person decided to put it... and has a display of associated files.
Assuming that you have some directory to node mapping happening somehow (e.g. Node 5 has related files in files\node5), then you can use the custom_layout function to create a block or module that understands your mapping and displays the directory the way you want.
Note that the custom_layout function only controls which directory to display when the page or block is loaded and the related navigational controls, e.g. no tree display, don't allow people to navigate to directories above the default, etc. It does not support filtering the content of the directory in any way.
See the case examples in #736548: Patch to add support for custom layouts for sample code...
Assuming you have a way of locating the webfm directory related to the node, then the simplest way might be to create a PhP custom block that determines the current node (lots of examples out there on how to use arg to get the node id in a block), then maps that node to the WebFM path you want, then use this as the input to custom_layout(). Then limit where this block is displayed by URLs for the nodes it needs to be displayed on.
A more complex alternative is to write a module that can map a url to the directory associated with your node and have this generate a page using the custom_layout() function.
Bottom line is that the WebFM module can't be everything to everyone... but the custom_layout function makes it possible for people to create code to solve their specific needs. And if the need is general enough, submit a "sub"-webfm module back to the community.