Johann Heyne
Forum Replies Created
-
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Won’t updateYou or the provider would need to upgrade the PHP version on the server to at least 7.5. The Table Field plugin uses PHP functions that are only available from PHP version 7.5.
If you have an account with your provider, you may be able to increase the PHP version there. But please also check that WordPress is up to date first.
Let me know if this is possible for you.
Cheers, Johann
I have released version 1.3.27, which should fix the PHP warning and the issue if no other plugin is causing this warning.
Thank you for reporting this issue. I’m investigating and fixing it.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Block Editor supportI should also mention that
acf_register_block_type()is deprecated and these settings should now be specified in amy-block-name/block.jsonfile. All of this is described in detail at the following link:
https://www.advancedcustomfields.com/resources/create-your-first-acf-block/Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Block Editor supportHi, good question.
When defining blocks using
acf_register_block_type(), there are different modes (auto,edit,preview) that determine where and when the ACF form fields appear. The default setting ispreview, where the ACF fields are displayed in the sidebar. I would not recommend this for the table field. I would recommendautolike in the following example:acf_register_block_type(array(
'mode' => 'auto', // auto, edit, preview
));When
previewis selected by default or with intention, the ACF input fields are displayed in the sidebar of the widget block editor. This is of course very impractical for the table field. But a user can toggle the preview to edit by the pen icon in the block toolbar.This toggling may could be disabled by the following:
acf_register_block_type(array(
'supports' => array(
'mode' => false, // disables preview/edit toggling mode
),
));But it would be interesting to know in which situation this has to be chosen.
For most standard blocks, the content input is not located in the sidebar. And I wouldn’t choose that for the table field either.
But since there is the possibility to place the editing of the ACF fields permanently in the sidebar, and if there is perhaps a good reason for this, a better solution for table editing in the sidebar would of course be helpful. Do you have a reason for intentionally moving the editing to the sidebar?
Thank you for raising this question,
JohannI bought the Beaver Builder Plugin and investigated the problem. It seems that only Beaver shortcodes are executed in the context of the flexible content layout shortcode
[wpbb-acf-layout]. The shortcode of the table field is then called later outside of that ACF loop in the wrong context and cannot function.One solution to the problem would be to use the WordPress filter
do_shortcode_tag, that filters the output created by a shortcode callback. Here is the filter that looks for tablefield shortcodes and then executes shortcodes. You can paste it in your functions.php. Then may the tables will appear.add_filter( 'do_shortcode_tag', function( $output, $tag, $attr, $m ) {
$tags = array( 'tablefield' );
$pattern = get_shortcode_regex( $tags );
if ( ! preg_match( "/$pattern/", $output, $matches ) ) {
return $output;
}
return do_shortcode( $output );
}, 1, 4 );Your Shortcodes should look like this:
[wpbb-acf-flex name="modules"]
[wpbb-acf-layout name="table_layout"]
<div class="layout ps-table">
[tablefield subfield-name="table"]
</div>
[/wpbb-acf-layout]
[/wpbb-acf-flex]Lets see if this works.
Thanks for the detailed description of the problem. That was very helpful.
There was an error in my shortcode example that prevented the tables from being displayed in the correct place. Please replace the shortcode function width the new one from the following FAQ tab.
https://wordpress.org/plugins/advanced-custom-fields-table-field/#how%20to%20use%20the%20table%20field%20in%20elementor%20or%20other%20page%20builders%3FIn your Elementor example, the shortcode call is already in a flexible content loop and in a layout context due to the surrounding
wpbbshortcodes. I hadn’t taken this situation into account, but have now adjusted the shortcode code example. Now you can directly use subfields of a Flexible Content Layout via the table shortcode. In your flexible content example the shortcode would now look like this:[tablefield subfield-name="table"]Note that in this context the shortcode parameter
field-nameis nowsubfield-name!This is now also documented in the following FAQ tab:
https://wordpress.org/plugins/advanced-custom-fields-table-field/#how%20to%20use%20the%20table%20field%20in%20elementor%20or%20other%20page%20builders%3FI hope that solves the issues.
Hi,
I have revised the shortcode example so that table fields in Group, Repeater and Flexible Content fields can now be queried.
Cheers,
JohannHi,
1.) Reading the field data for the Flexible Content field type differs from the Group field type. Therefore, the code for the shortcode must be adapted to your requirements.
See how to get ACF Flexible Content layout fields: https://www.advancedcustomfields.com/resources/flexible-content/#loop-example
Do you need help with that?
2.) Table field data should always be saved when a page is published or saved, regardless of the shortcode function. Do you get an empty table in the table editing view after saving a page like in the following screenshot?
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Need pro version to output table HTML?You don’t need the Pro version to output the table as HTML. Just follow the instructions at the following link and may create your own custom function to output the table HTML:
https://wordpress.org/plugins/advanced-custom-fields-table-field/#how%20to%20output%20the%20table%20html%3FIf you are looking for a build in function to output the table HTML, then this is possible with the Pro version. Under the following link you will find instructions on how the output works in the Pro version with
get_field()andget_table():
https://www.acf-table-field.com/docs/guides/view-table/php/latest/Hi Phil,
I don’t know what the scenario is, but maybe it has something to do with the fact that a table with just one empty cell is not considered valid and, depending on the implementation in the template, is not rendered as an HTML table.
If this doesn’t resolve or explains the issue, I need as much detail as possible to understand and reproduce the problem. The main points to start here are:
- WordPress and ACF version (free or pro)
- Browser and version
- The acf_register_block_type() parameters
- The template code for the block
- Step by step instructions that cause the problem
Thanks a lot
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Displayed HTML in table does not workA HTML string passed to
esc_html()is stripped of invalid or special characters before output.
This will cause HTML tags displaying as a text string.
See: https://developer.wordpress.org/reference/functions/esc_html/Example:
esc_html( '<a href="">Link</a>' )returns<a href="">Link</a>The next plugin release v1.3.26 will be available by the end of the week. But you can download and test it now:
https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.26.zipv1.3.26 should fix the missing table in the sidebar when using the Resizable Editor Sidebar plugin.
Thanks for the motivation and feedback. It helps.
Johann
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty rowHi,
you can test the version 1.3.26 that now has repairing missing data sections and ensures that all table sections and rows have the same number of columns. This might repair the table data consistency, but it will cause the data from cells that were created across the number of columns to be lost.
https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.26.zip
One reason for such data inconsistencies can be incorrect programmatic modification of table field data by using
update_field().I hope that the adjustment in v1.3.26 will ensure that such data inconsistencies do not destroy the usability of the table in the future.
Johann
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty rowThanks, that helped. I will come up with a solution.