tybruffy / ACF-Reusable-Field-Group

Advanced Custom Fields Plugin to reuse Field Groups
53 stars 16 forks source link

Wysiwyg Editor #5

Open tveelbehr opened 9 years ago

tveelbehr commented 9 years ago

Hi Tyler,

thanks for the great work on this ACF Field. It works perfectly, except the wysiwyg editor. Im using ACF 5.0 pro with the flexible content plugin.

If I place a wysiwyg editor field in a field group and then use this field group with your acf reusable field group plugin in a flexible content, the wyswig editor is not displayed. Only the tabs (visual/text) appear, but the editor toolbars are missing.

After saving the page, the editor renders as expected. if I add a new flexible content layout to the page, the wysiwyg editor of that new layout is broken again, until saving the page.

Is there a way to reload the tinyMce after loading the fields. Or any other work around? maybe you can point me in the right direction.

Best regards, Tobi

tybruffy commented 9 years ago

Yea this sounds like an issue related to the javascript, there's some weirdness between the reusable fields and the Flexible Content/Repeater style fields that I've never had the time to quite look out for.

I'm pretty swamped this week, but I'd be happy to accept a PR if you can fix the issue yourself, otherwise I will try to look into it as soon as I have some time.

tveelbehr commented 9 years ago

The problem does not only affect the wysiwyg fields. If you have multiple fields of the same type in repeater/flex content, the will overwrite each other on save. This seems to happen because the reusable field ids are the same, that also causes the tinymce to not load correctly. I checked the flexible content rendering of the sub fields, and they all have unique ids generated when added to the content. This part is missing in the reusable fields addon. I'm working on a fix. I will let you know when I'm done :)

socialblogsite commented 8 years ago

Have you found a solution for this? I don't know if I'm stuck at this or even after that ( a reusable group field used as a flexible content field returns null when I dump the content of the repeater's sub-fields)

I haven't found documentation anywhere to retrieve the field's data. I just realized they could be designed to be retrieved as regular fields, not sub-fields.

Can anyone lead me to some documentation/support link?

Is it possible it returns null because the post type for the source fields group doesn't match the current post type? (Using the same one makes the group to appear twice in the post editor)