4 of 34
4
New Extension: nGen File Field for FieldFrame
Posted: 08 April 2009 05:17 PM   [ Ignore ]   [ # 55 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007

Hi,

I’m sorry if I’m missing something completely obvious, but I’m getting a serialized array outputted when trying to use this as a single field (that is, not in a matrix).

My field name is multimedia_screenshot. My code (simplified) is:

{exp:weblog:entries weblog="multimedia" disable="categories|member_data|pagination|trackbacks" dynamic="off"}
<a href="#"><img src="{multimedia_screenshot}" /></a>
{/exp:weblog:entries} 

This gets outputted between the anchors: a:1:{s:9:“file_name”;s:13:“Picture_6.png”;}

I’m on php5. Any idea what could be going wrong here?

Thanks for the great work,
Matt

Edited because some of my code was getting dropped from the post….

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 08 April 2009 09:23 PM   [ Ignore ]   [ # 56 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  248
Joined  10-10-2007
slapshotw - 08 April 2009 09:17 PM

Hi,

I’m sorry if I’m missing something completely obvious, but I’m getting a serialized array outputted when trying to use this as a single field (that is, not in a matrix).

My field name is multimedia_screenshot. My code (simplified) is:

{exp:weblog:entries weblog="multimedia" disable="categories|member_data|pagination|trackbacks" dynamic="off"}
<a href="#"><img src="{multimedia_screenshot}" /></a>
{/exp:weblog:entries} 

This gets outputted between the anchors: a:1:{s:9:“file_name”;s:13:“Picture_6.png”;}

I’m on php5. Any idea what could be going wrong here?

Thanks for the great work,
Matt

Edited because some of my code was getting dropped from the post….


slapshotw try this instead

{exp:weblog:entries weblog="multimedia" disable="categories|member_data|pagination|trackbacks" dynamic="off"}

{multimedia_screenshot}

<a href="#"><img src="{file_name}" /></a>

{/multimedia_screenshot}

{
/exp:weblog:entries} 

I’ve put an example code here to show how it can be implemented

 Signature 

.
....................................................who we are...what we do...how you benefit

Profile
 
 
Posted: 08 April 2009 09:43 PM   [ Ignore ]   [ # 57 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  101
Joined  09-18-2008

@slapshotw Could you post or PM me a screenshot of your custom field settings for this field?

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 09 April 2009 12:45 AM   [ Ignore ]   [ # 58 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007
Cem Meric - 09 April 2009 01:23 AM

slapshotw try this instead

Thanks—I try it the loop way and get this outputted:

{multimedia_screenshot}
<a href="#"><img src="{file_name}" /></a>
{/multimedia_screenshot} 

@slapshotw Could you post or PM me a screenshot of your custom field settings for this field?

PM sent—thanks!

-Matt

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 09 April 2009 03:14 AM   [ Ignore ]   [ # 59 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  248
Joined  10-10-2007
slapshotw - 09 April 2009 04:45 AM
Cem Meric - 09 April 2009 01:23 AM

slapshotw try this instead

Thanks—I try it the loop way and get this outputted:

{multimedia_screenshot}
<a href="#"><img src="{file_name}" /></a>
{/multimedia_screenshot} 

@slapshotw Could you post or PM me a screenshot of your custom field settings for this field?

PM sent—thanks!

-Matt

Where is says “file_name” should be your sub custom field name. Referring to attachment I use

{exp:weblog:entries  weblog="weblog" limit="1"}

<ul>

{image}

 
<li>
  <
img src="{image_location}" alt="{image_description}" />
 </
li>

{/image}

</ul>

{/exp:weblog:entries} 

to generate html

 Signature 

.
....................................................who we are...what we do...how you benefit

Profile
 
 
Posted: 09 April 2009 03:19 AM   [ Ignore ]   [ # 60 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007
Cem Meric - 09 April 2009 07:14 AM

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.

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 09 April 2009 11:01 AM   [ Ignore ]   [ # 61 ]  
Summer Student
Total Posts:  14
Joined  01-04-2008

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?

Profile
 
 
Posted: 09 April 2009 11:05 AM   [ Ignore ]   [ # 62 ]  
Lab Assistant
RankRank
Total Posts:  191
Joined  01-20-2006

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

 Signature 

buro taggetig: freelance web design from Belgium.  |  Follow me on Twitter

Profile
 
 
Posted: 09 April 2009 11:56 AM   [ Ignore ]   [ # 63 ]  
Summer Student
Total Posts:  14
Joined  01-04-2008

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.

Profile
 
 
Posted: 09 April 2009 12:04 PM   [ Ignore ]   [ # 64 ]  
Lab Assistant
RankRank
Total Posts:  139
Joined  03-13-2009

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 ....

Profile
 
 
Posted: 10 April 2009 08:58 AM   [ Ignore ]   [ # 65 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  876
Joined  02-26-2008

Absolutely brilliant!

Profile
 
 
Posted: 10 April 2009 11:51 AM   [ Ignore ]   [ # 66 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007

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

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 10 April 2009 07:29 PM   [ Ignore ]   [ # 67 ]  
Grad Student
Avatar
Rank
Total Posts:  48
Joined  03-07-2009

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.

 Signature 

Steve Hurst | Novahurst Creative

Profile
 
 
Posted: 13 April 2009 03:02 PM   [ Ignore ]   [ # 68 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  358
Joined  01-04-2008

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

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 13 April 2009 03:06 PM   [ Ignore ]   [ # 69 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007

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.

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 13 April 2009 03:29 PM   [ Ignore ]   [ # 70 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  358
Joined  01-04-2008

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

 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
Posted: 13 April 2009 03:46 PM   [ Ignore ]   [ # 71 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007

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

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 13 April 2009 04:30 PM   [ Ignore ]   [ # 72 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  358
Joined  01-04-2008

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); 
 Signature 

my EE2 addons| Support forum | my EE1 addons
Like my addons? Follow me: @eecms @max_lazar

Profile
 
 
   
4 of 34
4