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: NB Show custom field data

Development and Programming

Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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… 😉

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

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

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.

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

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 Number: 1054

Description: Unknown column 'gypsy_weblogs' in 'field list'

Query: SELECT field_id, field_name, field_label, group_id, gypsy_weblogs FROM exp_weblog_fields WHERE group_id='1' OR gypsy_weblogs LIKE '%2%' ORDER BY group_id
       
Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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

       
Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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.

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

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:

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

       
Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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.

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

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?

       
Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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 😊

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

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.

       
shinka's avatar
shinka
147 posts
16 years ago
shinka's avatar shinka

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>

Notice: Undefined variable: ff_fieldtypes in /system/extensions/ext.nb_show_custom_field_data.php on line 297
       
Nicolas Bottari's avatar
Nicolas Bottari
143 posts
16 years ago
Nicolas Bottari's avatar Nicolas Bottari

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.

       
shinka's avatar
shinka
147 posts
16 years ago
shinka's avatar shinka

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.

Notice: Undefined index: ngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 238

Notice: Undefined index: ff_matrix in /system/extensions/ext.nb_show_custom_field_data.php on line 244

Notice: Undefined index: ngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 249

Notice: Undefined index: ngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 238

Notice: Undefined index: ff_matrix in /system/extensions/ext.nb_show_custom_field_data.php on line 244

Notice: Undefined index: ngen_file_field in /system/extensions/ext.nb_show_custom_field_data.php on line 249

etc.

       
shinka's avatar
shinka
147 posts
16 years ago
shinka's avatar shinka

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

However, I do have another problem for you to tackle. 😉 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.

Notice: Undefined index: selected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 604

Notice: Undefined index: selected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 623

Notice: Undefined index: selected_field in /system/extensions/ext.nb_show_custom_field_data.php on line 604
       
shinka's avatar
shinka
147 posts
16 years ago
shinka's avatar shinka

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.

       
1 2 3

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.