Johann Heyne
Forum Replies Created
-
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Only show table if it has content?OK,
get_field()returnsNULL, if the requested field is not saved in the database. If there is an empty table saved in the database,get_field()returnsFALSE. So usingif ( ! empty( get_field( 'my-table' ) ) { }ist the way, that should work.
Cheers,
Johann- This reply was modified 7 years, 4 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Only show table if it has content?Hi,
I was wrong. For some reason I´ve got
NULLusingget_field(). But it should beFALSEon an empty table so that your code example should work.I´m going to investigate that.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Only show table if it has content?Hi,
get_field()returnsNULL, if the table has no content. So you can use…if ( get_field( 'table_classic_editor' ) !== NULL ) { echo 'here is the table'; }or more general if the result is one of the following
NULL,FALSEor empty string''…if ( ! empty( get_field( 'table_classic_editor' ) ) ) { echo 'here is the table'; }WPML should not be part of that problem.
Cheers,
Johann- This reply was modified 7 years, 4 months ago by Johann Heyne.
- This reply was modified 7 years, 4 months ago by Johann Heyne.
- This reply was modified 7 years, 4 months ago by Johann Heyne.
- This reply was modified 7 years, 4 months ago by Johann Heyne.
Forum: Plugins
In reply to: [ACF: Focal Point] Fixes and Feature requestsHi,
there is an race condition issue when placing the focal point image inside an element, that also uses the jQuery resize event. In my situation I used a focal point image inside a Slick slider. After resizing the window, the image sometimes was not correct positioned. To fix that, I changed the code in js/focal-point.js…
var timeout; // When window is resizing... $(window).on( 'resize', function() { // Retrigger responsify.js $img.responsifyBackground(); clearTimeout( timeout ); timeout = setTimeout( function() { // Retrigger responsify.js once again after resize ends $img.responsifyBackground(); }, 250 ); });Cheers,
Johann- This reply was modified 7 years, 4 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ACF Table with Elementor ?Hi,
the table field is not supported by elementors ACF/dynamic fields because it is not a native ACF field and I can´t do anything about that to change. The only way to get a table fields data rendered by elementor is using an elementor shortcode widget.You can find an example about that in in my FAQs.
Chees,
Johann- This reply was modified 7 years, 4 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ACF Table with Elementor ?Hi Martin,
I remember that the forum guideline do not allow me to get in contact with you outside of this forum. I tested using the table field as an elementor Shortcode widget, see FAQs. What kind of problem do you have?
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] ACF Table with Elementor ?Hi martin,
see “How to use the table field in Elementor Page Builder?” on https://wordpress.org/plugins/advanced-custom-fields-table-field/#faq.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Gutenberg?I just created a ACF Block like code below and assigned a table field with name “table”. In the Gutenberg editor I can add the block with the table field, can add table content in the aside panel, changes appears in the block preview, can switch to edit the fields in the block itself, table content is still current. After saving the page I can select the table block and still edit its table in the aside, I can reload the page and the table content is still there.
My basic code for functions.php is…
add_action( 'acf/init', function() { if( function_exists('acf_register_block') ) { acf_register_block(array( 'name' => 'acf-table', 'title' => __('ACF Table'), 'description' => __('A custom table block.'), 'render_callback' => function( $block ) { echo '<p>Table Example</p>'; $table = get_field( 'table' ); echo render_table( $table ); }, 'category' => 'formatting', 'icon' => 'editor-table', 'keywords' => array( 'table' ), )); } }); if ( ! function_exists('render_table') ) { function render_table( $data = false ) { $return = ''; if ( $data ) { $return .= '<table border="1">'; if ( ! empty( $data['caption'] ) ) { $return .= '<caption>' . $data['caption'] . '</caption>'; } if ( isset( $data['header'] ) and is_array( $data['header'] ) ) { $return .= '<thead>'; $return .= '<tr>'; foreach ( $data['header'] as $th ) { $return .= '<th>'; $return .= $th['c']; $return .= '</th>'; } $return .= '</tr>'; $return .= '</thead>'; } $return .= '<tbody>'; if ( isset( $data['body'] ) ) { foreach ( $data['body'] as $tr ) { $return .= '<tr>'; foreach ( $tr as $td ) { $return .= '<td>'; $return .= $td['c']; $return .= '</td>'; } $return .= '</tr>'; } } $return .= '</tbody>'; $return .= '</table>'; } return $return; } }Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Gutenberg?Thanks. The 1.3.1-beta2.zip should work together with ACF 5.8.0-beta3.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Gutenberg?Here is the Beta2 version supporting the ACF Gutenberg blocks. Fixes an encoding issue.
https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.1-beta2.zipForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Gutenberg?Here is the latest version supporting the ACF Gutenberg blocks for beta testing.
https://downloads.wordpress.org/plugin/advanced-custom-fields-table-field.1.3.1.zipForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Gutenberg?Hi Shaun,
the current version of the table plugin has no Gutenberg block support yet, but the next version (1.3) will support blocks. The ACF version 5.8, which introduces the blocks, is still in beta and I´m still testing the block functionalities for a few days.
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Table Field LinesSee FAQ´s > “How to handle line breaks?” on https://wordpress.org/plugins/advanced-custom-fields-table-field/
Cheers,
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] add hyperlink inside the table.I agree. I´m working on a better table editing experience with a lot of requested functionalities. But even using the classic WordPress editor opens to a lot of errors.
What about using Markdown in your case?
For a website with so many pages, how to deal with hard-coded internal links on changed URLs? Would not it be better to use shortcodes for links using post ids like
[link post_id="1234" text="Link Text"]? Changes on the URl would not be a problem anymore. At least one could then check the existence of a URL of a link before linking the link text.Cheers,
Johann- This reply was modified 7 years, 6 months ago by Johann Heyne.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] add hyperlink inside the table.Hi,
you can add the links by writing HTML like
<a href="https://www.mydomain.com/my/link/">Link Text</a>.
I know, thats not user friendly. I´m working on it.The link attribute
target="_blank"opens the link in a new browser tab/window.
<a href="" target="_blank"></a>Cheers,
Johann- This reply was modified 7 years, 6 months ago by Johann Heyne.