Hi,
I need to create a svg graph from repeatable field values as data for custom publication type.
I had create the model, and a block based on acf block. But a can't get any data from toolset custom field.
content of block.json :
{
"name": "data-graph/aograph",
"title": "Graphique",
"description": "Graphique de données pour Appel d'offre",
"style": [
"file:./aoGraph.css"
],
"category": "formatting",
"icon": "images-alt",
"apiVersion": 2,
"keywords": [],
"acf": {
"mode": "preview",
"renderTemplate": "aoGraph.php"
},
"supports": {
"align": false,
"anchor": false,
"alignContent": false,
"color": {
"text": false,
"background": true,
"link": false
},
"alignText": false,
"fullHeight": false
}
}
Images :
repeatable fields edit
Block in model : call block Graphisme in model
Repeatable custom fields in publication edition
Source of php block render
<?php
/**
* Block template.
*
* @param array $block The block settings and attributes.
*/
$id = get_the_ID();
?>
HELLO WORLD <?php echo "ID {$id}"; ?>
<?php
$value = types_render_termmeta( "Effectif",array( "output" => 'raw' ) );
if( $value ) {
echo $value;
} else {
echo 'empty';
}
?>
I can get the post id, but no data with get_field() or types_render_termmeta() for simple or repeatable fields
How to do to get values of my repeatable or simple field in this block ?
Thank you ,
Best regard,