Johann Heyne
Forum Replies Created
-
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] More than one tableDefine more than one table fields in custom fields or use a repeater or the ad-on flexible-field. But you cant make two tables out of a single table field.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Create a TH rowYou could repeat the header after an interval…
$table = get_field( 'your_table_field_name' ); if ( $table ) { echo '<table border="0">'; echo '<tbody>'; $i = 0; $header_interval = 10; foreach ( $table['body'] as $tr ) { // header cells by interval if ( $i === $header_interval ) { $i = 0; } if ( $table['header'] AND $i === 0 ) { echo '<tr>'; foreach ( $table['header'] as $th ) { echo '<th>'; echo $th['c']; echo '</th>'; } echo '</tr>'; $i = 0; } $i++; // normal cells echo '<tr>'; foreach ( $tr as $td ) { echo '<td>'; echo $td['c']; echo '</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>'; }Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] More than one tableSure
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] help me border and padding tableOK, try this…
<?php $rows = get_field('repeater_field_name'); if($rows) { echo '<table class="table">'; foreach($rows as $row) { echo '<tr>'; foreach ( $row => $fields ) { echo '<td>Channel:' . $fields['channel_link'] .', Link:' . $fields['link_live'] .', etc</td>'; } echo '</tr>'; } echo '</table>'; } ?>Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] maximum of columns to 5Thanks, but the first version of this plugin is about basics. I put your request on my feature request list https://wordpress.org/support/topic/feature-requests-91.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Feature Requests- maximum of columns and rows
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Warning: urlencode() expects…I could not replicate that issue. Is it still exists? May can you provide more details like a screenshot of the table editor?
I try a fix by changing that json_encode() function that returned an array with the WordPress equivalent wp_json_encode() in the next release.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] two Heders in tableThere is no option yet for a row to define the type of that row´s cells.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Feature Requests- colspan and rowspan
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] two Heders in tableIf you want to repeat the header by interval, you can do something like that:
$table = get_field( 'your_table_field_name' ); if ( $table ) { echo '<table border="0">'; echo '<tbody>'; $i = 0; $header_interval = 10; foreach ( $table['body'] as $tr ) { // header cells by interval if ( $i === $header_interval ) { $i = 0; } if ( $table['header'] AND $i === 0 ) { echo '<tr>'; foreach ( $table['header'] as $th ) { echo '<th>'; echo $th['c']; echo '</th>'; } echo '</tr>'; $i = 0; } $i++; // normal cells echo '<tr>'; foreach ( $tr as $td ) { echo '<td>'; echo $td['c']; echo '</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>'; }Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ShortcodeI just registered that feature request in https://wordpress.org/support/topic/feature-requests-91?
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] hide table if there is no contentOK, by default, there is a single cell in the table editor. You are right. If this cell is empty, the table variable should not pass the
if ( $table )expression. I fix this in the next release. But if there are at least 2 cells with or without content, the table will show anyway. Because it seem not to be a good idea to check all cells content.Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ShortcodeI have no glue, if this is complicated, but I keep your request in mind for todo.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ShortcodeSorry, but there is no such option.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Warning: urlencode() expects…This is a strange warning because, the
urlencode()function contains another function calledjson_encode()that is definitely returning a string and never an arrayurlencode( json_encode( $data_field ) ). This function is also on line 169 and not 165. So the answers of the following two questions may help me.Do you have the current version of the plugin?
Is your PHP version greater than or equal 5.2.0?Thanks, Johann