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 😉
Thread Starter
Sean
(@seanhawkridge)
Great – I’ll get tinkering, and keep hoping for an official feature further down the line.
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.
@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?
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
Thread Starter
Sean
(@seanhawkridge)
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…
@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.
@sean – no, i’m afraid not, the “less busy” thing never quite happened…