0

I have a field group "teaser". Now my teasers have different types like:

  • linked headline + image
  • unlinked headline + image
  • indidivual html

The group itself is repeatable because you can add multiple teasers. Up to now I just had the different fields for all types and you would only fill the fields you needed (e.g.: There is a field "HTML" which is only considered if you chose the type "indidvidual html"). Now I have a new type of teasers where multiple images shall be shown in a row, like in a diashow. My problem is, that therefore you should be able to choose multiple images of any number inside the repeatable field group "teaser". But it seems only field groups can be repeatable and not a single field inside.

Also maybe my approach is completely wrong... maybe there is another way how to solve this.

I found the alternative plugin "Advanced Custom Fields", which might be able to do this, but unfortunately I cannot change the plugin for this project - it's already launched and I would rather extend the simple fields plugin, than updating the templates, redoing and refilling all fields.

So do I really have to extend the simple fields plugin to accomplish this?

Also there seems to be no option to make conditional fields for the cms only, like choosing an option (e.g. teaser type) and differ the shown fields in that way - but I am just curious if someone implemented something like that and could share his knowledge.

0

But it seems only field groups can be repeatable and not a single field inside.

Can't you make a dummy (image+something) group for this? Then, hide the something with CSS.

unfortunately I cannot change the plugin for this project

In the backend, if another plugin uses the same meta names -let's say Simple Fields and ACF- both plugins will show mirrored values (in non-repeatable cases). Although, I don't know if saving the post has unintended consequences. This is useful to make tests in a clone site before migrating from one plugin to another. In the frontend, using get_post_meta covers any plugin.

So do I really have to extend the simple fields plugin to accomplish this?

You could use ACF or a handmade solution to create another meta box.

there seems to be no option to make conditional fields for the cms only

ACF has that. Anyway, in this situations jQuery is our friend.

  • Hi brasofilo, thanks for your answer, and the hints. But i don't get your first suggestion to make a dummy group, because I can't add a group to a group, can I? My repeatable teasergroup has the fields: type, title, image, color, link, html. "image" would have to be repeatable, it might be even a solution for this case, just to edit the field so it accepts multiple files. Could you go further into detail with that one? – SamiSalami Oct 8 '13 at 8:34
  • I guess it'd have to be another meta box just for the repeatable field, no? – brasofilo Oct 8 '13 at 8:43
  • Well, I am having about ten teasers, which can be put into a custom order by dragging. If I am now adding a new meta box, I guess I could accomplish a link between regarding teaser and a group "dia show" via a field like "id", where both share the same id; but is this really what you mean? Because I don't see any hiding in that solution and it's kind of pain in the ass regarding the usability x) – SamiSalami Oct 8 '13 at 8:50
  • Personally, I don't see much options apart from migrating plugins (or using a second one) or writing your own thing. Hard to tell... let's see if someone knowledgeable of this plugin shows up. – brasofilo Oct 8 '13 at 8:53
  • Yeah, I decided now to change only the file field inside the plugin. Even if its not a long term solution, for now all solutions are not optimal and I will spend less unpaid time ;-) Thanks anyway for your hints :-) (if no one else shows up, I am ready to accept your answer) – SamiSalami Oct 8 '13 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.