Fieldtype

Developer
Supported

Nolan

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From iain

     

You must be logged in to post.

File upload

Support Request

kchatel
kchatel

I’m not able to select the upload directory through the file field. it defaults to the last file upload folder created. Is there a way to force it?

iain
# 1
Developer
iain

Hi there

This isn’t a bug as such, it just opens the native EE file manager with the default settings which is to show all available upload directories.

The problem at the moment is Nolan’s limited field settings. As you can see I’m using just text inputs that contain settings in a pipe separated sequence, getting things like upload directory id etc is not going to be particularly elegant in it’s current form.

Nolan 3 will have the settings set in a modal with a much better UI and less scope for errors. But for now, you can edit the field type’s javascript file and specify which directory id you want.

You’re looking for line 41 of themes/third_party/nolan_assets/js/nolan.js

Currently:

$.ee_filebrowser.add_trigger('.nolan_thumbnail_trigger'".nolan_thumbnail_trigger"{content_type"all"}, function(filefield

Replace that with:

$.ee_filebrowser.add_trigger('.nolan_thumbnail_trigger'".nolan_thumbnail_trigger"{content_type"all"allowed_file_dirs"x"}, function(filefield


Basically just specifying the directory id via allowed_file_dirs: “x” where x is your upload id.

Cheers
Iain

kchatel
# 2
kchatel

I made the change to force upload id 1but it still defaulting to the last upload directory created which is 3. I don’t have the usual Upload Directory: to select the directory to upload or choose a file.

kchatel
# 3
kchatel

I was able to do a workaround by renaming my Upload directories to

“1. CMS”
“2. Banners”
“3. Files”

Nolan seems to be only showing 1 directory and the 1st alphabetical one, being “1. CMS”. Not sure if that helps.

Colin Ambler
# 4
Colin Ambler

I just gave this a try too—changing the JS to add the upload destination id.  Unfortunately, no dice.

KD
# 5
KD

iain’s response was close to being correct. I got this to work in EE 2.8.1 by changing line 42 in the nolan.js file to

$.ee_filebrowser.add_trigger(’.nolan_thumbnail_trigger’, “.nolan_thumbnail_trigger”, {content_type: “all”, directory: “all”}, function(file, field) {