Johann Heyne
Forum Replies Created
-
I 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://www.ads-software.com/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
wpbb
shortcodes. 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-name
is nowsubfield-name
!This is now also documented in the following FAQ tab:
https://www.ads-software.com/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://www.ads-software.com/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.www.ads-software.com/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.www.ads-software.com/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.www.ads-software.com/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.
I have also sent a suggestion to the “Resizable Editor Sidebar” plugin development team on how to fix this unnecessary behavior of their script.
Thanks for the research. Yes, there is an issue with the “Resizable Editor Sidebar” plugin script. The “Resizable Editor Sidebar” plugin script fires every 500 milliseconds a jQuery UI resizable() at the sidebar element causing a mutation event every 500 milliseconds. That prevents the mutation observer threshold of the table field plugin of 500 milliseconds. I will reduce the table field mutation threshold number to fix that issue in the next plugin version.
Thanks,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty rowThis means that the column information in the table data is may incorrect or missing. Can you please send me the output of
get_field( 'your_broken_table_field_name', $post_id, false );
? This allows me to see exactly what went wrong with the table data.Thanks!
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty rowHi,
I integrated a table auto repair in the next unpublished version of the plugin (v1.3.25).
You can pre testing it, if that version helps to fix the table issue.Downloadlink v1.3.25:
https://downloads.www.ads-software.com/plugin/advanced-custom-fields-table-field.1.3.25.zipOn loading the page, the table with the protruding cells should be displayed repaired. The repaired table will only be permanently repaired when the page/content is saved. The contents of the protruding cells will be lost.
Cheers,
JohannHi,
thanks for reporting me that issue.
The
t.ui_event_ajax();
was replaced by a mutation observer to detect new tables in different situations and locations. For some reason this doesn’t seem to work in your situation. Can you help me clarify the circumstances?I would like to ask:
- Which browser and version are you using?
- Does the problem also occur in another browser?
- Which operating system and version are you using?
- Can you provide me the
acf_register_block_type()
parameters for your use? - Are there JavaScript errors in the console and can you provide them if relevant?
Thanks a lot,
Johann