We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension: nGen File Field for FieldFrame

Development and Programming

Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg
Where is says “file_name” should be your sub custom field name. Referring to attachment I use…

Thanks Cem. I understand that your code is correct when using FF Matrix, but I am trying to use the File Field standalone– that is, not within a matrix.

       
mapinfo's avatar
mapinfo
12 posts
16 years ago
mapinfo's avatar mapinfo

After working with the nGen File field with the matrix and as a standalone field, I have discovered that the extension code is assigning classes that do not appear to exist in the accompanying css file. The missing css classes are:

ngen-file-field-data ngen-file-field-new ngen-file-input

I have already verified that these fields do not exist in the ngen_file_field.css style sheet and that the style sheet is included - the ngen-file-delete-button class used to display the delete.png image is working. I have downloaded the latest nGen File field extension a couple of times to ensure I had the latest version.

Has anyone else run into this issue? Is this by design?

       
bobh's avatar
bobh
145 posts
16 years ago
bobh's avatar bobh

They’re probably there to provide some selectors for jquery.

       
mapinfo's avatar
mapinfo
12 posts
16 years ago
mapinfo's avatar mapinfo

I checked the jquery.ngen_file_field.js and that code does not look for the css classes I mentioned.

We can create the css styles to match the names assigned. What brought this to my attention is that the display of the nGen file field on our publish/edit screens is much different from that shown in the screen shots on the nGen site for this extension. I had assumed that what was shown in that screen shot is what I might expect to see without any customization of the styles on our end.

       
vladyn's avatar
vladyn
176 posts
16 years ago
vladyn's avatar vladyn

may I sound stupid, but I couldn’t install that or activade - I copied the files exactly where they should be, but how to activate / access this plug-in? EDIT: - Ahhh - part of the Field frame work ….

       
Arun S.'s avatar
Arun S.
792 posts
16 years ago
Arun S.'s avatar Arun S.

Absolutely brilliant!

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

OK, Brandon figured out the solution for my issue. I was using relative paths in the FieldFrame settings to point to the fieldtypes folder, which, while it works in the Control Panel, messes up the tagdata output. Adding this to the top of ext.fieldframe.php fixed it:

define('FT_PATH', "${_SERVER['DOCUMENT_ROOT']}/system/extensions/fieldtypes/");
    define('FT_URL', "${_SERVER['HTTP_HOST']}/system/extensions/fieldtypes/");

By the way, I use relative paths/dynamic paths because we have a development environment and the boxes have different hostnames and doc roots.

-Matt

       
Steve Hurst's avatar
Steve Hurst
36 posts
16 years ago
Steve Hurst's avatar Steve Hurst

Great addon, this field seems to work perfectly for me except for one issue - if the file already exists, I get a PHP “can’t write headers” error on publish. It seems that everything works, and it creates a derivative file, and displays in my weblog, but I think this error could scare my client if they ever run into a similar situation.

       
Max Lazar's avatar
Max Lazar
337 posts
16 years ago
Max Lazar's avatar Max Lazar

Its a great extension and thanks for this! But can somebody help with next error:

$ is not a function
[Break on this error] $('.ngen-file-delete-button').click( function() {
jquery.n..._field.js (line 1)
nGenFile is not defined
[Break on this error] nGenFile.lang.confirmDeleteFile = "Are you sure you want to delete this file?";

So, I cannot using ajax functions :(.

EE 1.6.7 20080320 jquery 1.3.2

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

There’s no AJAX with that function, just JS (as far as I know). But that seems indicative of a JS conflict. Are you running other extensions that add javascript to the control panel? I was having a similar issue with Solspace’s Primary Category.

       
Max Lazar's avatar
Max Lazar
337 posts
16 years ago
Max Lazar's avatar Max Lazar

yes, u right - in my case is conflict with Solspace Related Entries. I turn off everything but forget about it. Do u decide it?

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

I ended up modifying the Primary Category extension file to stop it from loading its own jQuery, which solved the issue.

       
Max Lazar's avatar
Max Lazar
337 posts
16 years ago
Max Lazar's avatar Max Lazar

ok. I find my way - if somebody will have the same error, u need to open file jquery.ngen_file_field.js and put (function($){ in begin and })(jQuery); in EOF. So u will have something like this:

(function($){ $('.ngen-file-delete-button').click( function() {
                if (confirm(nGenFile.lang.confirmDeleteFile) ) {
                    $(this).parent().next().children("input:last").val( $(this).parent().next().children("input:last").prev().val() );
                    $(this).parent().next().children("input:last").prev().val("");
                    $(this).parent().next().show();
                    $(this).parent().remove();
                }
                return false;
});

nGenFile = {};
nGenFile.lang = {};})(jQuery);
       
Cem Meric's avatar
Cem Meric
210 posts
16 years ago
Cem Meric's avatar Cem Meric
Great addon, this field seems to work perfectly for me except for one issue - if the file already exists, I get a PHP “can’t write headers” error on publish. It seems that everything works, and it creates a derivative file, and displays in my weblog, but I think this error could scare my client if they ever run into a similar situation.

For those who are having similar error on “if file already exists” such as

Notice: Undefined offset: 1 in C:\EE_install_folder\system\extensions\fieldtypes\ngen_file_field\ft.ngen_file_field.php on line 411

You can replace the if statement on line 411

if($matches[1]) {
$increment = "_" . ($matches[1] + 1);
} else {
$increment = "_1";
}

with this one

if(count($matching_files) == 1) {
$increment = "_2";
} else {
$increment = "_" . (count($matching_files) + 1);
}
       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg
For those who are having similar error on “if file already exists” such as…You can replace the if statement on line 411

Thank you!

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.