Fields

Fields is a WordPress plugin that let you manage custom fields in your write/edit page, giving you a more user friendly interface than the default one. Fields supports post types that have a UI.

With Fields, you can create boxes which will appear in your write panels. A box can contain a number of groups which are sets of custom fields that you can define. Boxes are displayed as meta boxes and groups are shown as tabs that can be switched inside boxes. Within a group, fields can be shown as either textfields, textarea, drop boxes, radio groups or check boxes.

Fields does not create custom post types, to do so, use other plugins such as WP Post Type UI.

Download from here

Features

  • Tabbed displayed
  • Multiple boxes per post type
  • Grouped fields
  • Support Textfields, Textarea, Drop boxes (select), Radio groups, Check boxes
  • Cross-post shortcodes

Installation

You can upload it directly into your wordpress blog:

  1. Download Fields from here
  2. Upload the whole 'fields' folder into '/wp-content/plugins/'
  3. Activate the plugins from the plugin list in your WordPress plugins page

Or use the built-in WordPress plugin browser

  1. Open your WordPress plugins page
  2. Select 'Add new'
  3. Search for 'Fields' and install
  4. Activate 'Fields'

After installation, you can administer the settings by openning the Fields --> Fields page.

How to use

Browsers compatability

This is embarrassing but Fields has only been tested on Firefox 3 and Safari 5 on Snow Leopard (Mac).

Comments (73)

  • fishy:

    Could you please provide a sample?

    Showing the code from the Boxes/Groups pages which was used to create the above sample would greatly help novice users.

    Also, is it normal for the options page to be blank?

  • Khanh Cao:

    Sure Fishy, I’m adding a usage section into this page. Yes, it is normal for the options page to be blank because I don’t have anything to put in there yet.

  • Khanh Cao:

    A how to use page has been added at http://calce.net/fields/fields-where-to-start

  • zyrq:

    Impressive plugin!

    Found a Typo in fields-builder-textarea.php line 21:
    fielld_update_meta should be field_update_meta
    Fields Version 0.2.4

    (cross posted from wordpress.org)

  • Khanh Cao:

    Thanks for the find Zyrq :-)

  • zyrq:

    You’re welcome.
    Could you please give an example how to print the value of the custom field.
    In the readme it says:
    * To display a custom field’s value, use meta(key)
    * To get the value only, use get_meta(key)
    However these give a Call to undefined function meta or get_meta.

    I tried echo meta(‘myfield’) etc.
    I could only get the value by using get_post_meta($post->ID, ‘_myfield’,true).
    Must be overlooking something.
    Thanks

  • Khanh Cao:

    Oh sorry for the outdated FAQ section in the readme. To get data, use:

    field_get_meta($key, $single = true, $id = ”)

    e.g. $value = field_get_data(‘title’);

    To echo it, use field_meta($key, $single = true, $id = ”).

    If your data has multiple values (textfields, check boxes), set $single to false.

  • aprxs:

    ver 0.3.2

    if wordpress (ver. 3.0) is installed in subfolder – in the Setting -> Fields page you get incorrect links to “Boxes”, “Groups” and “Settings” – all they link to root-folder of site (looking there for wp-admin/ folder)

    Example:
    installed wordpress in
    http://yoursite.com/wordpress/

    you get such links in Settings page:
    http://yoursite.com/wp-admin/options-general.php?page=fields&tab=boxes

    without “wordpress/” folder in path.

  • Khanh Cao:

    Thanks Aprxs, it’ll be fixed shortly

  • aprxs:

    One more problem.
    When on “Groups” page you are clicking on any key – you get error.

    This is because there is no variable of group in URL

    Here is an example:

    **/wp-admin/options-general.php?page=fields&tab=groups&item=&sub_item=fields-period&_wpnonce=062e26a95a&action=8

    Correct URL must look like this:
    **/wp-admin/options-general.php?page=fields&tab=groups&item=data&sub_item=fields-period&action=8&_wpnonce=062e26a95a

    with variable “item=data”

  • aprxs:

    ^^^
    wp 3.0, fields 0.3.2.1

  • Khanh Cao:

    Ugh, a big bug right there, I’ll look into it

  • aprxs:

    And also it would be nice, if there will be a “Clear” button for radio-buttons sets.

    Thank you, very useful plugin.

  • leland:

    Any support for image upload or better yet “image insert” from wordpress gallery or nextgen gallery.

  • Khanh Cao:

    Image upload, probably not for the time being but I’m adding image library browsing for the textfield. I’ll see what has Nextgen got for integrating

  • shawn:

    suggestion:

    I use Scribu’s plugin to link one post-type to another:
    http://wordpress.org/extend/plugins/posts-to-posts/

    example usage:
    1. post-type artists
    2. post-type albums
    3. post-type tracks

    This is a generic example, but in practice I create a an artist post-type and add an artist to it. By using a post-type I am able to apply any meta data that I choose.

    I then go in and create an album post-type and add an album with it’s own meta-data.

    Using the post-to-post plugin I am able to link the two types together very easy.

    What is missing:
    If I am adding an album, and the artist does not yet exist, I have to leave the album edit screen and go create the artist. I can then return and assign the artist to the album.

    idea using your plugin:
    As you have multiple panels, it would be nice to have the ability to add an artist while in the album edit screen.

    Basically having the ability to create one post-type object ‘artist’ within another post-type admin area ‘album’ so that the two can be linked together in one step.

    I’m picturing each ‘tab’ of your plugin being an ‘attached’ post type of another post-type.

    Do you like the idea and see the value in doing this with your plugin? — no other plugin does this quite yet, but eventually will become standard practice once people understand the power behind the concept.

  • Khanh Cao:

    @Shawn, yep got your idea, I think it’s possible to implement it into Fields, working on it

  • shawn:

    image/file upload concept code tested and works properly. Maybe it will help speed up adding this ability to your plugin….

    http://rilwis.googlecode.com/files/meta-boxes-2.2.php

  • shawn:

    @Khanh Cao

    Wow that was a fast response. Glad to hear you get the idea behind the concept. Multi-relational post-types, taxonomies, is going to become the next huge step for wp. It already works pretty good, just needs a nice UI to complete the job.

    I have worked with this for some time now, so if you need someone to bounce ideas off of, or to dig into beta testing the code let me know. You have my email addy already. I have a VERY good understanding of what is going on with linking post-types. Scribu’s code is downright brilliant. Combine that logic with your plugin and we’re there….

    thanks again

  • Khanh Cao:

    Yes I could see a new field with multiple values for connected posts, this field can be configured to accept a certain types of post and categories. Adding connected posts are done with ajax and fall back into two textfields, 1 for slug/id, 1 for post type if javascript is not enabled.

    One field can have as many rows as the user wants, each row is a link to another post.

    Then we have shortcodes and widgets to display the connected posts.

    I think I should put this field type into another plugin that extends Fields.

  • Victor Teixeira:

    Hi, thanks for the great plugin!

    Actually I have some problems with the display of the WYSIWYG editor on the Edit Content screen.

    Take a look: http://img2.pict.com/4a/82/f1/3846357/0/1280193909.jpg

    Imagine someone using a netbook… It’s a 1024px width screen.

    I think you could change the labels alignment,instead of the left they could be on top of the fields.
    Also, the Groups could be on the top, like tabs, or if I have only one group it’s label could just not appear at all.

    Another interesting feature would be to make full groups duplicable, just like individual fields are duplicable.

    As you can see I have lots of features in my mind.

    You could just take a look on the Custom meta box plugins out there like Simple Fields (http://eskapism.se/code-playground/simple-fields/) and Easy Post Types (http://wpeasyposttypes.com/) or even older ones like Magic fields, More fields and custom fields template.

    Simple fields has some great features like duplicable groups, image and file upload, drag and drop reordering, support for the media buttons above the editor, HTML mode, Box Location (normal, advanced or side), faster fields creation using js… But it lacks some of your plugin features like WP native user interface, duplicable fields…

    Easy post types has an import/export feature… but I don’t like that it integrates custom post type and taxonomy creation…

    I know these three plugins are really young… The only thing that I keep thinking is: why not the developers join forces and just make one really good and feature rich Custom Meta Box plugin for WordPress, we need it!

    Side note:

    I see drupals CCK (content construction kit) going into Core right now… The community relied on just one custom fields plugin and contributed for it to be the best possible with tons of other plugins taking advantage of CCK and including it as a dependency and other plugins just providing more advanced features and field types to CCK itself.

    I think this kind of stuff is what lacks in the WP community.
    Don’t take me wrong but plugin developers are competing against each other right now.

    Instead of building one super powerful plugin with 4 or 5 official developers, we see 4 or 5 plugins for the same functionality and each one lacking each other best features.

    What’s happening today on the WordPress community is that theme developers don’t want to depend on plugins afraid of the developer discontinuing the project – with lots of alternatives would that plugin get another maintainer? So we prefer to build everything by hand. This is a lot of time and effort wasted that could be used to contribute to the plugin development.
    Instead if there were 3 or more developers taking care of just one plugin, the community could easily rely on that plugin without fear…

    Then it happens what happened to WordPress forms plugins: there are lots of form builder plugins but no one is complete.. and then comes Gravity forms, a premium plugin with lots of features and addressing almost all the problems of the others, so it’s becoming the default form plugin for WP – a premium plugin – this is not good…

    Will the WP community have to rely entirely on Premium plugins?

    Just my thoughts…

    I wrote all this here just because I think your plugin is one of the best among them all and I think that if you join forces with other developers you could come up with the best, the default, the “canonical” plugin for custom meta boxes…

  • Victor Teixeira:

    Well I just realized that you are using native WordPress behavior regarding the Tabs of the groups… But adding the wysiwyg editor inside of it didn’t worked well.

    Maybe you could add an option to create a field directly inside the Box, without any group or better yet, if I define the box with just one group, it could be displayed withot any tab.

    Thanks, I just wrote too much…

  • Khanh Cao:

    Thanks Victor, a box with 1 group will not have tabs, I’ll get it done!

    Regarding the developers joining force for the best custom field plugin, I don’t think it’s possible unless somebody gather them all together and pay them for the work, otherwise everyone will just go their own way because as you can see the behavior of the plugins, we have different ideas on how they should work. If this by chance happens though, then the plugin might just become another premium plugin.

    About the tinymce editor, there is currently a bug I’m trying to figure out that whenever you move/sort a box, the editors inside become not editable. This happens to other plugins as well so I don’t wish to put much work on it until I’ve fixed that bug.

    Yes, I’ll put import/export functionality and image browsing as well but not creating fields with Js because creating fields is an action that the admin would not do everyday so I don’t think it’s worth the time to put the Ajax aspect in it. The post editing does happen more often and this task is more likely to be done by non tech-savvy persons hence I’m putting more work on it to give it the best user experience as I can.

    Thank you for your feed back Victor! Oh and I’m sorry but I still don’t get the meaning of duplicate groups.

  • Victor Teixeira:

    Thanks for the reply.

    Regarding the duplicate groups, just take a look on the screenshots of the Simple fields plugin – http://farm5.static.flickr.com/4007/4636465609_7648f0a6c5.jpg and http://farm4.static.flickr.com/3326/4625005403_4c57aa8379.jpg and http://eskapism.se/wordpress/wp-content/uploads/2010/05/simple-fields-example-2-31.png

    Those are duplicable groups – notice the “+ Add” on the top.

    This is just a really important feature – see how it can be easy to end users to configure slideshows and image lists with title, description and options for each image. It can be used to configure almost any repeatable content.

    And that’s what I was talking about: your plugin is really good and has almost all the features that one may need and this great user interface and then there’s Simple fields that has repeatable groups, image field which gets the image from the WP media manager, configurable box location, ajax interface, media buttons above the editor… all good stuff, but lacks a simple repeatable field.

    Victor Teixeira

  • Victor Teixeira:

    I saw that you just updated with the changes.
    You also corrected the display of the “Add more” button. Great!

    I just updated my screenshot: http://img2.pict.com/e8/42/ed/3849766/0/1280247011.jpg

    If you put the field labels on the top it would be perfect.

    Thanks.

  • Khanh Cao:

    I’ve just updated Fields to 0.3.4, groups now can have one or two-column layout

  • Victor Teixeira:

    WOW! Thanks man!

    Now this is perfect!

    Check the screenshot: http://img2.pict.com/4d/c6/13/3856031/0/1280336826.jpg

    I’ll take a look into your plugin code and see if I can contribute some features like drag and drop reordering of fields, date field type and file field type, option for the box location (normal ou side)… if you like, of course.

    About the bug on tinymce, I just found that if you refresh tinymce it you work again. Ex: on simple fields you can switch to html mode disabling tinymce and when you enable it again it works.

    Maybe you can fire a js to refresh it when the box location changes.

  • Victor Teixeira:

    Just to keep you in the loop: I’m making some tests here and I just found that if you toggle fullscreen mode on the tinymce editor then you get the media buttons and you can insert media into the editor.

    Amazing stuff!

    See another screen: http://img2.pict.com/42/b4/e3/3856264/0/1280338928.jpg

  • Khanh Cao:

    Yeah, it’s quite a cheap but good move to just tell the clients to click full screen for the time being.

    If you need to create your own field type, have a look at this sample plugin: http://calce.net/wp-content/uploads/2010/07/myfields.zip

    It’s still not easy to understand it though.

  • Victor Teixeira:

    Another follow up:

    It has some problems: when you insert the image it gets inserted into the primary editor also, so you have to delete it there.

    If you add a caption to the image it doesn’t works (at list using the shortcode mode, I didn’t tested with php on the theme yet – I guess it’s because this generates one shortcode inside the other…).

    Another one: with the labels on top of the fields, the buttons to delete the duplicate fields disappeared. No way to delete them. Maybe they could just go to the right side with this setup.

    Just noticed that the images I’m posting here are not working anymore. I’m using a Google chrome extension that takes the screenshot and automatically uploads to this service.

    I’ll upload to another place.

  • Khanh Cao:

    My bad, I’m fixing the delete buttons issue

  • Victor Teixeira:

    The screenshots:

    Backend: http://i.imgur.com/sNQru.jpg

    Frontend: http://i.imgur.com/we4UH.jpg

  • Khanh Cao:

    That is so messed up but somehow I’m not being able to reproduce it. On my page, the picture in the field doesn’t go into the content

  • Khanh Cao:

    Ah it seems the image’s caption is another shortcode

  • Khanh Cao:

    Updated to 0.3.4.1, the Field shortcode now processes shortcodes within the fields values. To disable this, use remove_filter(‘fs_shortcode’, ‘fs_shortcode’)

  • Victor Teixeira:

    Hi, I’m testing the output in a template and I can’t get the duplicate field right.

    First I just put this:

  • Victor Teixeira:

    the code didn’t appear:

    echo field_get_meta($key=tecnicas, $single= false);

  • Victor Teixeira:

    Then I received Array as the output.

    So I just looped through the array:

    $tecnicas1 = field_get_meta($key=’tecnicas’, $single= false);
    foreach ($tecnicas1 as $tecnica) :
    echo $tecnica;
    endforeach;

    The output: aaaa

  • Victor Teixeira:

    I got it working with do_shortcode() function:

    echo do_shortcode(“[field key='tecnicas' single='no' separator=',']“);

    How can I make it work with field_get_meta()?

  • Victor Teixeira:

    I gave up trying field_get_option() and got it working with this code:

    foreach ($tecnicas as $tecnica) :
    $tecnica = maybe_unserialize($tecnica);
    echo $tecnica[value];
    endforeach;

  • Victor Teixeira:

    The correct code:

    $tecnicas = get_post_meta($post->ID, ‘_tecnicas’);

    foreach ($tecnicas as $tecnica) :
    $tecnica = maybe_unserialize($tecnica);
    echo $tecnica[value];
    endforeach;

  • Khanh Cao:

    There is a bug in field_get_meta(), I’m fixing it. Oh and the correct syntax for it is

    $meta = field_get_meta('tecnicas');
    or $meta = field_get_meta('tecnicas', false);

  • Victor Teixeira:

    Hi, the last update 0.3.5 broke the plugin.

    The fields are not saved or doesn’t appear on the Edit screen as they were saved…

  • Khanh Cao:

    Thanks Victor, updated to 0.3.6, hope you did not lose too much data, sorry :-)

  • Victor Teixeira:

    No problems, I’m just testing stuff.

    Again, thanks for the great plugin.

    The best custom fields plugin right now.

  • Victor Teixeira:

    Hi, just a follow up comment.
    I just shown your plugin in action to my partner and then she said that something was strange.
    Immediately I fired IE8 and that’s the screenshot of the write post page with Groups configured to be only 1 column:
    http://i.imgur.com/LYBMa.jpg

    If you want I can make some CSS tests here for IE8 and IE7 and try to correct this.

  • Khanh Cao:

    Thanks Victor, I’d really appreciate it if you can fix it, the css file for it is css/edit.css

  • Khanh Cao:

    Victor I’ve updated Fields to 0.3.8 which should have fixed the IE bug but two-column groups still have a horizontal scrollbar when they stay on the sidebar

  • Hi!

    I must say that this plugin is very nice indeed. Very nice GUI and very nice usage of shortcodes.

    I’m an author of a fields plugin myself called Simple Fields (I saw that Victor mentioned it) and I think that next to mine (*cough cough*), this is the best fields plugin so far. :)

    I’m gonna try this plugin out for a bit. But just after 5 mins I see that it has a couple of features that I like and that I probably should add to Simple Fields too. Hope you don’t mind that!

    Keep up the good work. WordPress need more plugins like this!

  • Khanh Cao:

    Pär feel free to grab what you like, the more you do, the less work I have to spend :P

Leave a comment