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

FieldFrame

Development and Programming

Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

I just released a new extension: FieldFrame.

FieldFrame provides a framework for rapid development of fieldtype extensions

If you’ve ever written your own custom fieldtype extension, you probably remember how much work was involved before you could even begin working on your actual fieldtype logic. That’s a thing of the past now, if you build it as a FieldFrame fieldtype.

Take a look at a sample Checkbox fieldtype (based on one that comes bundled with FieldFrame):

class Checkbox extends Fieldframe_Fieldtype {

    var $info = array(
        'name'             => 'Checkbox',
        'version'          => '1.0.0',
        'desc'             => 'Provides as single checkbox field type',
        'docs_url'         => 'http://brandon-kelly.com/',
        'versions_xml_url' => 'http://brandon-kelly.com/downloads/versions.xml'
    );

    function display_field($field_name, $field_data)
    {
        global $DSP;
        $checked = ($field_data == 'y') ? 1 : 0;
        return $DSP->input_checkbox($field_name, 'y', $checked);
    }

}

That little guy is all it took to get a simple chekbox fieldtype working.

But FieldFrame can handle much larger projects as well. For example, as part of the upcoming Playa 2 release, I ported it to FieldFrame, gutting nearly half of the code in the process.

View the complete documentation at the FieldFrame Wiki on GitHub.

If you’re having trouble with FieldFrame, support is being handled through Get Satisfaction

Enjoy!

Changelog

Subscribe to the Atom feed

1.0.3

fixed conditional tag bugs fixed undefined offset bug

1.0.2

fixed json_encode bug affecting < PHP 5.2 FieldFrame now respects “Automatically Convert High ASCII Text to Entities” global weblog setting FF Matrix {count} template variable has been renamed to {row_count} other bug fixes

1.0.0

we’re golden! added a link to the Fieldtypes Manager in Admin > Utilities added a script that will convert LG Data Matrix fields to FF Matrix (accessible from FF Matrix site settings in the Fieldtypes Manager) removed FF Checkbox Group site settings added a single template tag option to FF Checkbox Group and FF Multi-select which returns an unordered list. FF Matrix now has two single variable tags: “count” and “total_rows” bug fixes and cleanup

0.9.9

FF Matrix will now ignore rows that have no data FF Matrix template tags now accept two additional parameters, sort and limit bug fixes

0.9.8

fixed a bug where only the first cell setting would be saved fieldtype site settings are now accessible immediately after being enabled

0.9.7

fixed the “white screen of death” bug fieldtype site settings now match the FF Matrix field settings

0.9.6

bundled FF Multi-select added Date and Select celltypes added Max Length setting to the Text celltype added Textarea Rows setting to the Textarea celltype added a single template tag option to FF Matrix which returns an HTML table fixed a bug that prevented creating new FF Matrix rows with two columns using the same celltype

0.9.5

bundled FF Matrix added Built-in Convenience Functions to fieldtypes FieldFrame now passes $field_data to save_field() as the first argument rather than $field_name

0.9.3

each fieldtype gets a hidden “field_ft” input placed before its display_field() HTML bug fixes

0.9.2

added Default Settings and Tag Params functionality added fieldtype requirements functionality (see Defining Your Fieldtype’s Requirements) FieldFrame now passes $field_settings to save_field()

0.9.1

bundled FF Radio Group fieldtype added formatting_available and direction_available flags to display_field_settings()

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hi Brandon,

Looks like this will be really helpful to a lot of people. I just wish I understood coding extensions a lot better than I do and then I would probably dip in and make a few. I just always get stuck on them and time is unfortunately money so never really get around to learning what I would really like to learn :-(

Was just wondering though, using this is it possible to make say a custom field type to get rid of the problem people keep on having of that being needing a field that has the database column set to be INT instead of text so that sorting will work correctly?

Looks like fantastic work though and a great contribution to the community so thanks for that. Looking forward to your new Playa 2.0 and also seeing what others create with this! 😊

Best wishes,

Mark

       
BridgingUnit's avatar
BridgingUnit
214 posts
16 years ago
BridgingUnit's avatar BridgingUnit

This is great Brandon,

I’ve just written a Member Groups fieldtype for this as I needed it for a project I’m working on. Will publish it as soon as I get a moment to polish it a bit more.

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

FieldFrame has been updated to 0.9.1.

In this update, a new fieldtype, “FF Radio Group” joins the other two bundled fieldtypes, FF Checkbox and FF Checkbox Group.

Fieldtype extensions also now have an easy way of toggling whether the Text Formatting and Text Direction blocks are available on the Edit Field form.

-Brandon

       
joann22's avatar
joann22
176 posts
16 years ago
joann22's avatar joann22

There is a nice write up http://devot-ee.com/articles/item/creating-a-custom-fieldtype-for-expressionengine-with-fieldframe/ about creating one.

I like this:

What it boils down to in layman’s terms is that FieldFrame will take care of much of the ugly parts of developing an extension – and there are a few ugly parts including some nasty RegExp stuff, among other considerations too heinous to mention here.

:)

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Unfortunately having a slight problem with this extension. As soon as I enable it I get this error message appearing and then I can’t get back into my control panel :

Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘fieldframe::show_full_control_panel_end’ was given in /usr/local/psa/home/vhosts/********.co.uk/httpdocs/*******/core/core.extensions.php on line 262

If I delete the FieldFrame rows from the exp_extensions table then I get back up and running again but would really like to try this one out so just wondering if anyone has any ideas what’s going wrong there?

Best wishes,

Mark

       
Macrike's avatar
Macrike
137 posts
16 years ago
Macrike's avatar Macrike

Whoa!

I’ve been looking for a way to have a ‘release date’ type of custom field, with date, month and year values and the possibility to only select a month and year, or only a year. The way I’m doing it now is three custom fields, one for each value.

With this extension, is it possible to create a custom field just for this purpose?

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Brandon, thanks for providing this functionality. I just created a drop down list for country codes based on code that Ryan did for US states. It was a snap to implement!

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

@Macrike - Yes that’s absolutely possible with FieldFrame.

@Sue - Awesome! Glad you like it. Are you going to release it publicly?

       
Macrike's avatar
Macrike
137 posts
16 years ago
Macrike's avatar Macrike

Awesome! Now I just have to figure out how on earth to do it. :lol:

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

It took me more time to figure out how to use GitHub than to write the extension.

sc.countries_select.ff_fieldtype

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hello all,

I’m having problems getting this to work on a site (works fine on a completely separate site, running on the same dev server).

As soon as I enable the FF extension, I just the dreaded blank screen of death in the CP. Manually deleting the hooks from the extensions table restoring the CP to full working order.

I realise this is a very vague question, but has anybody come across a similar problem (and solution) before? At the moment I have no idea where to start looking.

Edit Could the fact that this site is using a non-standard prefix for the database tables (i.e. not “exp_”) be the cause of the problem? My understanding was that EE is smart enough to cope with that.

Thanks, Stephen

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

There are a couple other people having that issue (see http://getsatisfaction.com/brandonkelly/topics/blank_page_when_enabling_extension).

I’m going to look into it further as soon as I get a chance. If you can help debug yourself, that would be greatly appreciated!

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
I’m going to look into it further as soon as I get a chance. If you can help debug yourself, that would be greatly appreciated!

Thanks Brandon, I’ll see what I can find.

Cheers, Stephen

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

For those following, the “white screen of death” bug has been fixed in FieldFrame 0.9.7

Lots of other changes have happened since the initial release, as well. I’ve added a changelog to the opening post in this thread.

You can also Subscribe to the Changelog feed to keep up to date with FieldFrame’s progress.

-Brandon

       
1 2 3 Last

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.