I’m wondering if it’s possible to add a custom setting to a layout within a flexible content field? The defaults are ‘Label’,’Name’,’Min’,’Max’. I toyed around with acf/render_field_settings and was able to add a setting to everything EXCEPT the layout meta. Unless I’m missing something, layouts don’t appear to be saved as field type. Any suggestions would be much appreciated!
As far as I know, there’s no way to actually do it “out-of-the-box”. There’s a workaround tho. Within each one of your layouts, add one “clone” field, which will clone an entire field group. The targeted field group will be used as a “template”.
Then, you can easily add custom settings to your “template” field groups, using the action acf/render_field_group_settings coupled with acf_render_field_wrap() function.
You now have field groups which are actual Flexible Content layouts, with custom settings (Image upload, Google map etc…). Just remember to deactive them, so they won’t appear on regular post types out of the flexible content 😉
If you’re interested, I have a list of all fields which can be used as field group settings and their behavior. Just let me know if you want it!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users