bobbingwide / field-block-for-acf-pro

Field block for ACF PRO
https://www.oik-plugins.com/oik-plugins/field-block-for-acf-pro/
GNU General Public License v2.0
3 stars 0 forks source link

Add option to display the field's label #22

Open bobbingwide opened 9 months ago

bobbingwide commented 9 months ago

Currently, if you want to display the label for a field and it's value it's necessary to use more than one block. The first would be a paragraph block containing the required label, the second the acf field block. eg The labels are in the first column, the values in the second.

image

This is a bit cumbersome. It would be nice to request the block to display the label as well as the value. It would also be nice to be able to override the value of label.

Requirement

Proposed solution

The generated HTML would change from

<div class="acf-field-field_64aa869f48df7 acf-type-text has-text-align- wp-block-acf-field-acf-field">Content for the Text field</div>
<div class="acf-field-field_64aa869f48df7 acf-type-text has-text-align- wp-block-acf-field-acf-field">
<div class="label">Text</div>
<div class="value">Content for the Text field</div>
</div>

This could easily be styled as a grid.

bobbingwide commented 8 months ago

v1.3.0 is now available on wordpress.org. I downloaded it to s.b/cwiccer to test but the Display label logic isn't working.