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
updated guternberg docs to reflect ACF Block >v6 #2945
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ecupaio for taking a shot at this! 🎉 I created quite a few suggestions/changes but don't let that put you off. The overall structure is nice! You might want to consider moving the section about the render callback up, right after registering the blocks. This way we first handle the PHP side of things before moving into the json/twig side.
Another suggestion is to maybe have the twig file inside the directory of the block as well. Personally I find is very useful in reusing blocks between projects.
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
@Levdbas thanks so much for this. I'm with you on restructuring the block twig for ease of implementation and I was not sure on how to order the steps since they are all co-dependent on each other so thanks for that suggestion. I still want to map the JSON values for the developer so even if they are blindly copy pasting, they can at least have a reference later on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another few minor fixes
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
Co-authored-by: Erik van der Bas <erik@basedonline.nl>
@Levdbas thanks! I added those new suggestions in, reordered the render block step, and I updated the tutorial to include the twig template within the block structure. |
Hi @ecupaio , I took the liberty to add a commit myself to your PR. I am using ACF blocks myself quite a lot so I wanted to chime in on some concepts as well. Please let me know what you think and if you see any improvements to make just let me know. We are on the right track here! |
@Levdbas that is quite alright. My mission here is to have descriptive documentation for ACF blocks in timber that anyone can follow and be successful. Your contributions have been helpful in achieving that objective. |
Thanks @ecupaio , one of the other @timber/rangers will do a check before we merge this. We are always looking forward to people contributing to Timber. If you like to help improve the documentation for Timber, check out the following open tickets: https://github.com/timber/timber/issues?q=is%3Aopen+is%3Aissue+label%3Adocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over the docs and made changes in d56c196
(#2945). Most updates are about documentation style to match what we already have.
I also removed the comments in the JSON file, because developers will copy that piece of code and we don’t want to confuse them with invalid JSON.
Thanks a lot for taking the time to put this together @ecupaio! It’s a great addition to the docs.
This has also been a question in the Swiss WordPress community Slack channel, so I’ll be finally able to link to that 💪.
Related:
Issue
Updates to ACF Blocks documentation to reflect the use of block.json in ACF v6
Solution
Wrote very descriptive docs on how to add blocks to a Timber theme.
Impact
No impact on code, just less frustrated devs.
Usage Changes
none
Considerations
n/a
Testing
n/a