Closed (fixed)
Project:
Upload path
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2007 at 16:35 UTC
Updated:
8 Sep 2008 at 08:34 UTC
Jump to comment: Most recent file
Comments
Comment #1
Crell commentedHm. I suppose that would likely involve moving the confirm form to the node type config page. Of course, how then would you just set a single global rule? Or per-node type with a fallback to global if nothing is specified?
Comment #2
webchickGlobal fallback seems like the best option. yeah.
Something like:
Global upload path:
[ textfield ]
[ node type #1 (collapsed fieldset: no value exists yet) ]
[ node type #2 (expanded fieldset: value exists ]
[ textfield ]
etc.
Comment #3
lewmich commentedYES. This feature would be really worthy. Sollution presented by webchick in #2 looks great.
Comment #4
doc2@drupalfr.org commentedI need this badly too, especially to avoid conflicts with the image and video modules.
Else, what code to put in the module to avoid certain content type?
Just below
If (isset($node->files)) ..., I tried to put something likeif ($type->image) { } else {upload_path code}. I tried withissetas well, but, see, I'm a newbie and couldn't make it work.Big thanks in advance! Greetings,
Arsène
Comment #5
davidwhthomas commentedI added this feature to my install of uploadpath.
You can set the upload path for each content type.
If a path is not set, the default uploadpath path will be used.
The files are attached.
To install, you can just overwrite the existing files with the new ones and visit the file upload paths config / settings page
Comment #6
Crell commentedDavid, can you roll a proper patch so people can review it? Thanks.
Comment #7
davidwhthomas commentedHere's the patch generated from :
See attached :-)
Comment #8
doc2@drupalfr.org commentedI'll try this soon and let you know! Thanx in advance David!
Comment #9
doc2@drupalfr.org commentedHey, big thank you! Looks and works great!
Comment #10
doc2@drupalfr.org commentedJUST IN CASE: Patch suggestions for per-nodetype uploadpath redirection without default:
http://drupal.org/node/192752
Comment #11
davidwhthomas commentedThanks, glad to hear it works for you too.
I'm using it myself and it's working perfectly :-)
There's a few notes in the comments that could be taken out of a released version (lines 101 - 103 in .module file)
and I'm considering adding the bugfix ( http://drupal.org/node/153737 ) as an optional config setting that can be toggled from admin, in case people want to switch it off, but it works for me and fixes the bug I had with the token module and dates and allows setting paths for each node type.
Thanks to the original dev as this is a very useful drupal extension!
regards,
DT
Comment #12
doc2@drupalfr.org commentedSupport request on uploadpath_20071108_patched module:
Thanx for any hint or explanation!
Arsène
Comment #13
davidwhthomas commentedRe: Support request on uploadpath_20071108_patched module
In that case, you would create the pattern:
video/[term]for the "Video" node / content-type.
you could also set it as :
[type]/[term] or [type]/[cat]as the default pattern and [type] will be replaced by the 'video' content type name.
[type] selects the node type
[term] selects "Name of top taxonomy term"
or perhaps
[catpath] "Same as [cat], but including nodes supercategories separated by /"The available tokens are listed in the 'replacement patterns' fieldset in admin > site configuration > file upload paths
It's useful to add date tokens to order your folders by date.
e.g if a pattern like :
[type]/[yyyy]/[mm]orders files automatically by creating folder by date.
regards,
DT
Comment #14
SergeyK commentedDavid, thank you for the great job! Your module works fine on my almost clear D5 installation and solves token module date() error message (http://drupal.org/node/153737). But now I am thinking of another feature. Is it possible to integrate "clean" node title produced by Pathauto module into Uploadpath path rendering? Imagine, you have a story titled "Lorem, ipsum". For this node Pathauto (when tuned properly) will generate a path like www.example.com/lorem-ipsum (notice, comma is eliminated, space is replaced by hyphen separator char). As for Uploadpath, used with [title] pattern, it will generate path like www.example.com/lorem,_ipsum. What am I looking for is a common way for naming stories' aliases and paths of images attached to that stories, so that image.jpg will sit in www.example.com/lorem-ipsum, not lorem,_ipsum. Is it possible to implement a hook or fetch processed title data from Pathauto for Uploadpath?
Comment #15
davidwhthomas commentedThe latest patch is available in this related thread:
http://drupal.org/node/192752#comment-657282
DT
Comment #16
davidwhthomas commentedcommitted