WordPress.org

Ready to get started?Download WordPress

Forums

Developer's Custom Fields
Repeatable Fields / Cloning (9 posts)

  1. Sean
    Member
    Posted 2 years ago #

    Hello -

    I've been using Developers Custom Fields on a number of sites and it's excellent - I'm not sure what I'd do without it!

    I was wondering if there was still a plan to be able to add multiple values for fields - as mentioned in the to do list on your site?

    I'm not sure I've quite got my head around what this would look like, but there are situations where, for example, I need to create an itinerary of an unspecified number of days, and would love to be able to create Day 1 and for the user of the site to be able to add days and descriptions using this plugin.

    http://wordpress.org/extend/plugins/developers-custom-fields/

  2. Steve Taylor
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Sean, glad the plugin's so useful.

    Multiple fields I had a go at ages ago and got stuck. I called it "field cloning", because the idea is that you could flag as field as being clonable, and it would get something like a "+" icon next to it for the user to add another value for the same field. I'd love to get it done but it's not critical because there are other approaches that can approximate this.

    Depending on the data, you could use a textarea and get the user to enter multiple values on separate lines - then explode a value by a newline character or something.

    You can dynamically build up your field definitions array for slt_cf_register_box, based on a value that should work well as an upper limit, i.e. create field_1, field_2, etc. with a for loop.

    I'm sure there's other workarounds you can come up with to dynamically adjust to individual posts using the plugin's hooks.

    But yes, really it needs a system. All I can say is, it's on the to-do list. And I'm open to patches ;-)

  3. Sean
    Member
    Posted 2 years ago #

    Great - I'll get tinkering, and keep hoping for an official feature further down the line.

  4. Simon Blackbourn
    Member
    Posted 2 years ago #

    Hi Sean/Steve

    This tutorial might be handy: http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra-fields

    Specifically the bit on repeatable fields near the bottom.

    Maybe it's possible to incorporate this concept into this plugin? I might give it a go myself in a couple of weeks once I'm less busy.

  5. Steve Taylor
    Member
    Plugin Author

    Posted 2 years ago #

    @Lumpysimon, thanks! I've not found time to work on that feature at all. It would be great if you could crack it!

    I'm flat out until mid-Feb or so, but do shout if you have any queries about how the plugin code works.

    Would it help you if the plugin was on GitHub?

  6. Simon Blackbourn
    Member
    Posted 2 years ago #

    that would be great if you're up for it, otherwise i can just contact you direct via your website.

    no big hurry as i'm unlikely to have time during the next 2-3wks myself.

    cheers
    simon

  7. Sean
    Member
    Posted 1 year ago #

    Hello - sorry to bump this thread

    @Lumpysimon, did you ever find time to see if you could integrate the js from the WP-Tuts tutorial? I just checked it out again today, and took a look through the commented-out work on 'cloning' that Steve has done, but struggling to see how the two might be combined...

    I'm working on a project where this would be so cool - although I'm realising what I might actually need it a repeatable box rather than field - so a new section with title/text/image could be repeated. I suppose if necessary it could just be a wysiwyg field...

  8. Steve Taylor
    Member
    Plugin Author

    Posted 1 year ago #

    @Sean, sorry, this is a bit of a long-standing loose end for this plugin. All my development on it is project-driven cos I'm so busy, and I've always been able to easily route around the lack of true repeatable fields.

    The stuff in the code that's commented out may or may not be the best way to proceed - it's just where I got to when I was trying to implement it.

  9. Simon Blackbourn
    Member
    Posted 1 year ago #

    @sean - no, i'm afraid not, the "less busy" thing never quite happened...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic