Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ACF - Local JSON #254

Open
iMicknl opened this issue Jun 11, 2016 · 7 comments
Open

Add support for ACF - Local JSON #254

iMicknl opened this issue Jun 11, 2016 · 7 comments

Comments

@iMicknl
Copy link

iMicknl commented Jun 11, 2016

Would it be possible to add support for the Advanced Custom Fields, Local JSON option? ACF is highly used by theme developers and this (pro) option is a must have. It dramatically speeds up ACF and allows for version control over the custom fields.

https://www.advancedcustomfields.com/resources/local-json/

Normally you would just create a directory acf-json in your current theme, where all the fields are saved in JSON format (and updated by every change). This is in this case not very easy, because it should then be in the current 'build' theme...
Any suggestions?

@Maximilianos
Copy link
Member

Okay, thinking about how this could be done.. it is a tad bit tricky, but should be possible.. main thing would be to create it in the most "elegant" and re-usable way. Will try working on it when I have time. please, let me know if you have any ideas as well :)

@iMicknl
Copy link
Author

iMicknl commented Jun 21, 2016

I wasn't sure about the best option yet; the only idea I had at the moment was changing directories through: acf/settings/save_json and acf/settings/load_json, so it is inside the theme folder. And then in the build theme, just do it in main folder.

But that will be quite a hacky solution maybe..

@iMicknl
Copy link
Author

iMicknl commented Jul 12, 2016

@Maximilianos I 'fixed' this in my fork, but I was wondering about your ideal approach. If you agree with this method; I can create a pull request. In development mode, I change the location to the dev theme where they are saved in the acf-json folder. On build this acf-json folder is moved to the production theme and Advanced Custom Fields Pro can read it automatically.

@ginatrapani
Copy link

I'm interested in getting this working. Is there a place I can see the commit to your fork @iMicknl? It doesn't seem to be public

@iMicknl
Copy link
Author

iMicknl commented Jul 15, 2016

@ginatrapani it was indeed a private fork. I just created a public fork and also did open a pull request.
(#258)

@ginatrapani
Copy link

@iMicknl ah, thank you so much! So appreciated!

@retani
Copy link

retani commented Dec 15, 2016

It usually works very well. But I ran into problems when creating a new Field Group in ACF. Whenever I save, it creates a new JSON file and it's a mess. The workaround is to stop gulp while creating a new field group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants