Wondering why you can't post?
To post, head over to our current forums.
   
1 of 3
1
New Extension: NB Show custom field data
Posted: 17 August 2009 09:45 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Inspired by extensions such as pinpoint and NP Show categories, I wrote this extension, which displays custom field data in the “Edit weblog entries” section of the Control panel.

In addition to the entry title, entry_id, etc, I wanted a quick way of viewing multiple entry data without having to individually open each entry in the Control Panel, visiting each template on the site, or searching through the database.

Here are some situations where this extension may come in handy:

- On multilingual sites in which each entry contains custom fields for each language. Useful, for example, when you want to see the {title} and {title_jp} fields in the CP Edit section to compare English and Japanese entry titles.
- Similar to the above, the extension can be a quick way to check if the entry has been translated into Japanese, for example, by looking for content in the {title_jp} field.
- As a quick way to check if data has been entered in a specific custom field.
- May be useful in viewing and comparing how data is stored in a custom field (for example, in a serialized array - I had to use this recently to check if I imported a FFMatrix serialized array correctly)

Custom fields can be set for each weblog. Should also work even with Brandon’s excellent gypsy extension installed.
I’m new at EE extension-making and this is my very first extension, so I assume there will be bugs. Feel free to report them. I also hope this type of extension hasn’t been done before… wink

I have a few ideas to improve the extension, and will probably have updates to the current version later. Suggestions or advice are welcome.

Documentation and alternate download

File Attachments
NB_show_custom_field_data_0.8.2.zip  (File Size: 14KB - Downloads: 136)
Profile
 
 
Posted: 17 August 2009 11:17 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  06-27-2007

This is awesome!  Seems like it wouldn’t take much to customize the output- ala a more flexible version of Wegee/LG thumbs that everyone has wanted for NGen’s file uploader.  Ill take a look asap.

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 17 August 2009 11:21 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  06-27-2007

Seems to have a conflict- either if you don’t have Gypsy installed, or have uninstalled it in the past.  - It is looking for the Gypsy DB when I go to settings:

MySQL ERROR:

Error Number1054

Description
Unknown column 'gypsy_weblogs' in 'field list'

QuerySELECT field_idfield_namefield_labelgroup_idgypsy_weblogs FROM exp_weblog_fields WHERE group_id='1' OR gypsy_weblogs LIKE '%2%' ORDER BY group_id 
 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 17 August 2009 02:35 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Good catch. I didn’t think it would throw an error. I’ll have a look and come up with a fix.

Profile
 
 
Posted: 17 August 2009 07:59 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Alright, I updated the extension to v0.4, mainly to fix the mysql error that was thrown if gypsy has never been installed.

- Fixed a mysql error appearing if the gypsy extension has never been installed.
- Added better table headers to the extension settings page
- Light cleanup

The latest file can be found at the top post. Let me know if the problem persists.

Profile
 
 
Posted: 18 August 2009 09:36 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  06-27-2007

Its a slick extension for sure.  Seems to me all the magic happens in any innovation you can give to the settings screen.  Like if I could wrap my custom field in code then it becomes that much more powerful. 

For instance if I’m calling my image field I could wrap it in:

<img width="80" src="{article-image}"

 

Then I would have a decent weegee clone with more flexibility. Hell if you could add any logic- the extension would be the edit menu’s version of fieldframe.

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 29 August 2009 06:34 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Sorry for the wait. I have updated the extension to version 0.5 (didn’t feel bold enough to call it 1.0 yet).
This version has a number of changes and options on how data is displayed in the Edit section. Although I didn’t add functionality similar to LG Image preview, I tried to make a few file types available for download from the Edit section if the correct file upload folder is selected in the extension’s settings (I’ll try to work on not having to ask which upload folder to use in settings).

The extension now supports display options for custom field data depending if the field is normal text, an nGen File Field or FF Matrix field.

Here are the changes:

* Changes to the settings code
* The extension now requires the jQuery for the CP extension to be enabled to function properly
* New: nGen File field display type in settings page for nGen File field custom fields
* New: FF Matrix field display type in settings page for FF Matrix custom fields
* New: option for trimming character length for Text display type
* New: option for file upload directory selection for File display type
* New: option for number of rows to display for FF Matrix display type
* New: Display field name option in Edit section
* New: Display field label option in Edit section
* Added French and Japanese language files
* Code cleaning and commenting


Let me know if there are any problems with this version. Latest file is in the first post.

Profile
 
 
Posted: 29 August 2009 09:31 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  06-27-2007

Hey Nicolas- This update sounds awesome!  When I download off of the first post, it looks like I am still getting 0.4. Could you please double check which file is uploaded?

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 29 August 2009 10:56 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Thanks!

Although I forgot to change the version number in one of my comments in the code (which shouldn’t affect the extension), looks like the download is fine. Just to be sure, I reuploaded the file. Tell me how that goes. Worst case, try the alternate download grin

Profile
 
 
Posted: 30 August 2009 07:51 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  06-27-2007

This one is definitely different- thanks for fixing.  I didnt have any of the new options on the previous.  Looks like the format you are working on will scale nicely to add thumbs and more in the future.

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 31 August 2009 07:05 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

Looks like a fantastic extension. Will be great once it allows thumbnails or at least accurate links to images in the Control Panel.

One problem, I’m getting multiple errors that look like this. I’m sure it’s me because it works error free on another installation.
It works, it’s just throwing this error, many times with different line numbers listed>

NoticeUndefined variableff_fieldtypes in /system/extensions/ext.nb_show_custom_field_data.php on line 297 
Profile
 
 
Posted: 31 August 2009 08:50 PM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

shinka, could it be that one of your EE installations has never had FieldFrame installed?
Just in case, I have updated the extension to 0.5.1, which should fix this problem. Please let me know if the problem persists.

Profile
 
 
Posted: 31 August 2009 08:56 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

I think that was the problem. I installed it without installing FieldFrame first. I’ve installed it now, but I’m still getting errors, they’re slightly different this time. I’ve tried removing the extension and adding it again (the new version) but it hasn’t fixed it.

NoticeUndefined indexngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 238

Notice
Undefined indexff_matrix in /system/extensions/ext.nb_show_custom_field_data.php on line 244

Notice
Undefined indexngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 249

Notice
Undefined indexngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 238

Notice
Undefined indexff_matrix in /system/extensions/ext.nb_show_custom_field_data.php on line 244

Notice
Undefined indexngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 249 

etc.

Profile
 
 
Posted: 31 August 2009 08:59 PM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

Nevermind. It seems that turning on the FieldFrame field types fixed the problem. I always forget that step.
Thanks for your help. smile

However, I do have another problem for you to tackle. wink
When I select one of my weblogs from the Edit Tab AJAX menu, I get the following error. Now it’s only one of my weblogs, not any other. An it’s a weblog that doesn’t have a custom field selected by your extension.

NoticeUndefined indexselected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 604

Notice
Undefined indexselected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 623

Notice
Undefined indexselected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 604 
Profile
 
 
Posted: 31 August 2009 09:03 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

I figured it out. It was a weblog that didn’t have any custom fields. I used the weblog to assign other entries to them as a relationship field to use their status as a global variable. Adding a custom field that I’m not using seems to have fixed the problem, but it’s a work around.

I noticed the problem in the Extension Settings page. All of the drop-downs that had custom fields had a default ‘–’, but my weblog without a custom field was blank instead. I’d rather not have custom field I’m not using there, but I understand this is a special case.

Thanks again for your help.

Profile
 
 
Posted: 31 August 2009 09:16 PM   [ Ignore ]   [ # 15 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Thanks for your input, shinka. Just in case, I updated the extension to 0.5.2 so that errors are not thrown if field types haven’t been selected yet. wink

Interesting about the error when no custom fields are set for a weblog. I assumed everyone used at least one custom field per weblog. I mean, custom fields is the magic of EE, right? wink

Thanks for finding the error in this rare situation, I’ll try to fix this in a later version.

Profile
 
 
Posted: 31 August 2009 09:23 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

Haha, yeah I can understand how it’s a unique situation. Basically I’ve got sports seasons (like Baseball 2009, Football 2009, etc.) and I have players assigned to those sports through a relationship field. I use the custom statuses of the sports season entry to turn on and off online voting as well as turning on and off other display features. It works pretty well to keep everything organized but it doesn’t require any custom fields to make it work, lol.

Profile
 
 
Posted: 09 September 2009 08:14 AM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  147
Joined  09-30-2008

Since I had this lying around but still at a decent stage, I’m updating the extension to version 0.6. Here are the changes, including one that some may like, even though it’s pretty basic wink

* Includes a few fixes for errors when Fieldframe field types have not yet been enabled
* No more need to specify upload directory for File display type
* New: option to limit the number of rows to show for FF matrix display type
* New: options to show FF matrix field names and labels above the matrix
* New: “Image” display type, based on upload folder containing at least one image file
* New: simple image thumbnail. Image size is set based on width in settings. This is only an image resize of the original image, no thumbnail file is created
* New: link to original file for Image and File display types
* Settings form cleanup: text in settings page should take less vertical space.

I should really add an auto-update feature… Probably in the next version smile

Profile
 
 
Posted: 09 September 2009 09:04 AM   [ Ignore ]   [ # 18 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  165
Joined  03-19-2008

Thanks for the update. The thumbnail creation seems to be working beautifully. I have a new error for you though. smile

NoticeUndefined variableimageUploadDirIds in .../system/extensions/ext.nb_show_custom_field_data.php on line 356

Warning
Invalid argument supplied for foreach() in .../system/extensions/ext.nb_show_custom_field_data.php on line 356 
Profile
 
 
   
1 of 3
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 149971 Total Logged-in Users: 71
Total Topics: 103610 Total Anonymous Users: 36
Total Replies: 518112 Total Guests: 320
Total Posts: 621722    
Members ( View Memberlist )