Johann Heyne
Forum Replies Created
-
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Flexible Field & Responsive Table$table = get_sub_field('table');Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Flexible Field & Responsive TableHi,
1. The following code should do the trick with the data-title…
$table = get_field( 'your_table_field_name' ); if ( $table ) { echo '<table border="0">'; if ( $table['header'] ) { echo '<thead>'; echo '<tr>'; foreach ( $table['header'] as $th ) { echo '<th>'; echo $th['c']; echo '</th>'; } echo '</tr>'; echo '</thead>'; } echo '<tbody>'; foreach ( $table['body'] as $tr ) { echo '<tr>'; foreach ( $tr as $key => $td ) { echo '<td data-title="' . $table['header'][ $key ]['c'] . '">'; echo $td['c']; echo '</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>'; }2. Yes, the table field should work in a Flexible Content field.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Feature Request: CaptionHi,
you can download the upcomming version 1.3.0 including support for table caption…
https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.0.zipThe basic template code including caption is…
$table = get_field( 'your_table_field_name' ); if ( $table ) { echo '<table border="0">'; if ( ! empty( $table['caption'] ) ) { echo '<caption>' . $table['caption'] . '</caption>'; } if ( $table['header'] ) { echo '<thead>'; echo '<tr>'; foreach ( $table['header'] as $th ) { echo '<th>'; echo $th['c']; echo '</th>'; } echo '</tr>'; echo '</thead>'; } echo '<tbody>'; foreach ( $table['body'] as $tr ) { echo '<tr>'; foreach ( $tr as $td ) { echo '<td>'; echo $td['c']; echo '</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>'; }Please test and let me know, if this fits your request.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Feature Request: CaptionHi,
in general, it would be possible. But is a simple text input enough for every use case of the caption? The same issue already came up for the cells content. Requests like “caption should be required” or “caption should be Rich Text” are better to solve using an separate ACF field for editing the caption. The only point to include a caption input field option in the table field is to have that option visually bundled width the table field. Is it a good move to add a caption text option? What do you think?
Cheers,
Johann- This reply was modified 7 years, 7 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Elementor SupportHi,
I just worked out a solution using the Elementors shortcode widget. See https://wordpress.org/support/topic/advanced-custom-fields-table-field/#post-10855834
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Advanced Custom Fields: Table FieldHi,
in general, its up to Elementor to support ACF field types on the Elementor widgets. Under the link https://docs.elementor.com/article/381-elementor-integration-with-acf you can see all supported ACF fields in Elementor for now. But because the table field is not a native ACF field, the support may never happen.
The way to go is using the Elementors shortcode Widget. Before you can use a shortcode to display a table fields table, you have to setup a shortcode in functions.php. The following code does this. You can modify the table html output for your needs.
function shortcode_acf_tablefield( $atts ) { $a = shortcode_atts( array( 'field-name' => false, 'post-id' => false, ), $atts ); $table = get_field( $a['field-name'], $a['post-id'] ); $return = ''; if ( $table ) { $return .= '<table border="0">'; if ( $table['header'] ) { $return .= '<thead>'; $return .= '<tr>'; foreach ( $table['header'] as $th ) { $return .= '<th>'; $return .= $th['c']; $return .= '</th>'; } $return .= '</tr>'; $return .= '</thead>'; } $return .= '<tbody>'; foreach ( $table['body'] as $tr ) { $return .= '<tr>'; foreach ( $tr as $td ) { $return .= '<td>'; $return .= $td['c']; $return .= '</td>'; } $return .= '</tr>'; } $return .= '</tbody>'; $return .= '</table>'; } return $return; } add_shortcode( 'table', 'shortcode_acf_tablefield' );Then use the shortcode in a Elementors shortcode widget like this, to insert a table from the current page or post…
[table field-name="your table field name"]You also can insert a table from another page or post…
[table field-name="your table field name" post-id="123"]Or you can insert a table from a ACF option page…
[table field-name="your table field name" post-id="option"]Cheers,
Johann- This reply was modified 7 years, 7 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Table Editor BrokenHi,
thanks for the info. Unfortunately, I could not replicate that issue.
The issue could appear if the field was previously a different field type than a table field and contains a JSON format, such as {“key”:”value”} from the previous field type.
To narrow down the cause of the error, you could proceed as follows:
– Try a new fresh table field.
– Disable table field plugin an look for other console errors which could affect the execution of the table field plugins script.
– Try disabling other plugins.
– Try another theme.
– Try the two plugins on a new fresh installation of WordPress.
– Try the two plugins on a new fresh installation of WordPress on another server.If this does not bring any success and knowledge, then I will send you a link to a newer version of the plugin which includes some tests and console messages to narrow down the issue.
Greetings,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Table Editor BrokenHello,
can you please give me some data:
Browser Name:
Browser Version:
Operating System:
WordPress Version:
ACF Version:Thanks,
Johann- This reply was modified 7 years, 7 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] JS errors in consoleHi,
sorry for the delay, I was very busy at this time. Unfortunately your links expired. Can you renew them please and may provide an example console error message?
Thanks,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Translated to DanishHi, thanks a lot for the translation. I just released your translation in the version 1.2.5.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ACF table Pro or updated version ?Hi, thanks for asking. Yes, a Pro version is on its way, slowly but for sure. The pro version will be independent from the free version. Both, free and pro, can run side by side.
The main features are a WYSIWYG Editor with customizable Toolbars, col- and rowspan, import data from CSV, choice field of classes independently for the table, cols, rows, cels, thead, tfoot. In the field setting you will have a pre-definable table in detail the same way you edit a table, min and max rows and cols, defining of class choices, enable or disable features separately for the table, cols, rows, cells, thead and tfoot.
I have no timetable for the release. Some challenges are still pending and decisions to make. A message will appear in the free version, when the public beta test starts.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Elementor SupportHi, I am sorry, but I have no experience with Elementor. Do you visualized other field types on a dynamic field of an Elementor widjet? This should work the same with tables fields using the output table HTML code on https://wordpress.org/plugins/advanced-custom-fields-table-field/
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ACF Tables on Custom PageHi,
the Table Field Plugin requires and enhances the “Advanced Custom Fields” plugin.
Or did you mean editing the table on the frontend by acf_form() https://www.advancedcustomfields.com/resources/acf_form/ ?
There is no way to pre-define column headers.
Cheers,
JohannForum: Reviews
In reply to: [Table Field Add-on for ACF and SCF] Another untested unfunctional pluginDue to changes in the design of the plugin pages, my original suggestion that this plugin is an add-on has disappeared. I have corrected that now.
Forum: Reviews
In reply to: [Table Field Add-on for ACF and SCF] Another untested unfunctional pluginThis plugin extends the functionality of the plugin “Advanced Custom Fields”. May I should write that clearly on top of the description to save lifetime.
Thanks,
Johann