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?
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.
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
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.
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
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);
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);
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.