Johann Heyne
Forum Replies Created
-
Thanks for the details. Just to prevent a misunderstanding before I dig deeper into the problem…
If you use conditional logic to toggle between fields (table/text), all conditional logic fields and their data will be saved and retained but hidden. A field hidden by a conditional logic will keep and return its data by get_field() or get_sub_field(). So you have the check in your template the value of the select field and only return the associated fields of the conditional logic.
if ( have_rows( 'tabs' ) ) { // loop through the rows of data while ( have_rows( 'tabs' ) ) { the_row(); $select = get_sub_field( 'select' ); if ( $select == 'text' ) { $text = get_sub_field( 'text' ); if ( $text ) { echo '<p>' . $text . '</p>'; } } if ( $select == 'table' ) { $table = get_sub_field( 'table' ); if ( $table ) { // echo the table } } } } else { echo '<p>no rows found</p>'; };Hello,
I can´t replicate that issue in an standard WordPress environment. Maybe the issue is a side effect in an rare situation. Can you give me please some more informations?
– PHP Version
– ACF Version
– Browser Type and Version
– WordPress Version
– Other Plugins
– may other fields or content on that template
– Is there a JavaScript failure in the console?Thanks!
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty Table ShowingHello Samara,
I can´t replicate that issue in an standard WordPress environment. Maybe the issue is a side effect in an rare situation. Can you give me please some more informations?
– PHP Version
– ACF Version
– Browser Type and Version
– WordPress Version
– may other fields or content on that TemplateThanks!
JohannForum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] get_row_layout returning empty stringThe Plugin provides a field not a row-layout. You can get the value of an table field inside a row-layout with get_sub_field( ‘your-table-field-name’ );
if ( get_row_layout() == 'flex-content-layout-name' ) { $table_data = get_sub_field( 'your-table-field-name' ); }More about get_sub_field() https://www.advancedcustomfields.com/resources/get_sub_field/
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Feature RequestsHello beth,
I´m sorry to tell you, that I´m not finished yet with the pro version.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Empty Table ShowingThe get_field() function returns only false if there is only 1 table body cell in the table and this cell is empty. It does not matter whether there is a header or not.
Once multiple columns or rows exist, whether they are empty, get_field() returns the table data array.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] No Wrapper AttributesThe “Wrapper Attributes” are not part of the plugin. They are available in ACF version 5.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Requirements of pluginThe Table Field plugin can be used with ACF version 4 and 5.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] Duplicate ContentWell, it is up to you what you do with the table data in your php template. It is a php thing.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] weird output on using the pluginYou are welcome.
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] weird output on using the pluginYou have to get a custom fields content with the function get_field() http://www.advancedcustomfields.com/resources/get_field/. This function returns an array of the table data. Then you have to build the table HTML from that array with php code like described here… https://wordpress.org/plugins/advanced-custom-fields-table-field/
If you don´t know, what to do, you perhaps don´t have the skills to get true. The code you sent
{"p":{"o":{"uh":0}},"c":[{"p":""},{"p":""}],"h":[{"c":""},{"c":""}],"b":[[{"c":"Acidumis the table data stored in the database in json format. You get this code, if you grab the content of a custom field by the WordPress function get_post_meta() https://developer.wordpress.org/reference/functions/get_post_meta/ which is the way to do without ACF.Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] weird output on using the pluginIs the Table Field plugin activated? And do you get the field´s data with get_field() or get_sub_field()?
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] get field echoing jsonNice, this is a topic for the plugins trouble shouting page.
Thanks!Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] get field echoing jsonThere are to many
)at the end in line…$product->getProductRepeater('measurements', 'content_table', get_the_ID()));Anyway, I tested this class and it worked as expected.
Strange
Forum: Plugins
In reply to: [Table Field Add-on for ACF and SCF] get field echoing jsonYour code is ok.
May there went something wrong with the PHP json_decode() function in your server environment. Please test the following code that should decode the JSON string to an array…
var_dump( json_decode( '{"p":{"o":{"uh":0}},"c":[{"p":""}],"h":[{"c":""}],"b":[[{"c":"aa"}]]}', true ) );It should output this…
array(4) { ["p"]=> array(1) { ["o"]=> array(1) { ["uh"]=> int(0) } } ["c"]=> array(1) { [0]=> array(1) { ["p"]=> string(0) "" } } ["h"]=> array(1) { [0]=> array(1) { ["c"]=> string(0) "" } } ["b"]=> array(1) { [0]=> array(1) { [0]=> array(1) { ["c"]=> string(2) "aa" } } } }