-
Notifications
You must be signed in to change notification settings - Fork 0
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 generic ACF block to display any field #7
Comments
Oh nuts, the string "field_" may not be used at the start of a field name. |
Looks like there's already a Meta Field Block plugin!
|
I was having difficulty getting ACF to display a new field added to the Testimonials group. I believe this was because the plugin is calling |
I've looked at the documentation and raised an request on ACF Slack #help channel. Had a reply but I'm none the wiser really. I can't yet see why my definition is allowed to override the user defined fields. I can see a use for local fields when it comes to ACF blocks. Once the fields for a block have been defined they can be registered in response to BTW. In s.b/wordpress I've now created the |
In s.b/wordpress and s.b/cwiccer, having added the field group for Testimonials to the
One note of interest is that the placeholder for an empty field is the same in both meta boxes. |
I've made some more progress. Rather than doing manual database queries, I've used When the local JSON files aren't in use then the query performed is
If the
This solution enables the user to define the fields to be associated to the |
I haven't dug any deeper into this problem. Basically, when the field was empty then the default value being displayed was the same even if the user defined default was different from the hardcoded version. |
…matically when not already configured #7
The prototype logic in dddc26e should be reworked:
|
Duplicating the ACF Field block and changing the Field name attribute leaves unwanted data values Original block with
After duplicating and changing the field name to
After changing the field name to
Then, later on, the value disappeared
|
Front end rendering of fields of type
For some reason the image is already displayed in the block. Not sure why. |
Requirement
SolutionI've refactored again.
In edit mode the block currently looks like this. Now I have to eliminate fields which are only registered for blocks. In this example they're the first 6 in the drop down. |
I changed the select list to only display the internal field name & key when SCRIPT_DEBUG is true The logic includes fields for which the But the Field group name after the field name can be misleading... It would be better to list one or more post types for which the field is applicable.
|
In this example I added a Location Rule of Post Type is not equal to Posts Implementation
|
The logic to display a WYSIWYG field is to display the content ASIS. No But there's are a couple of problems:
The
Note: The oembed works in the editor - I can see the iframe. |
Now adding support for |
When I added support for the For improved extensibility I should do the following:
|
For ACF extensions see https://www.awesomeacf.com/ |
The acf-field block's enclosing div should include the usuals suspects for a WordPress block in the
Q: Does |
The |
Now that the acf-field-block plugin has been developed it's time to disable the generic field block logic in oik-testimonials. I need to do this soon since I've twice encountered problems where the logic in oik-testimonials overrides the logic in acf-field-block.
Both of these were due to oik-testimonials trumping the output of acf-field-blocks. |
Closing in favour of #8 |
The Author name block developed for #6 is a rather trivial block.
Suppose I wanted to add an
_author_image
field to display next to the author name.I'd have to develop a new block similar to the first one.
It wouldn't take much effort to copy and cobble the first block, but it would become laborious if I had to do this for lots of fields.
Wouldn't it be better to create a generic
acf-field
block that could display the value / values of any field registered to ACF?Requirement
acf-field
blockProposed solution
oik-testimonials/acf-field
field-name
field where the user can enter the field name to be displayed.Note: I've not use
the_field()
for anything other than a text field so this is an opportunity for me to try each of the field types.Starting with an image.
The text was updated successfully, but these errors were encountered: