Support

Account

Home Forums Add-ons Repeater Field Dynamic flexible content title

Helping

Dynamic flexible content title

  • Hi,
    I have flexible_content named “Block” and inside flexible_content I have field named “Block title”, how can I use value from “Block title” and append that value to “Block” title, I’m using fields from php file

    I’ve tried this without any success

    $field = get_field_object('field_55f40ea5ea5d7');
    $block_title = $field['value'];
    
    'layouts' => array (
    	array (
    		'key' => '5532d11ce4dba',
    		'name' => 'posts_picker',
    		'label' => 'Block' . $block_title,
    		'display' => 'block',
    		'sub_fields' => array (
    			array (
    				'key' => 'field_55f40ea5ea5d7',
    				'label' => 'Block title',
    				'name' => 'block_title',
    				'type' => 'text',
    				'instructions' => '',
    				'required' => 0,
    				'conditional_logic' => 0,
    				'wrapper' => array (
    					'width' => 50,
    					'class' => '',
    					'id' => '',
    				),
    				'default_value' => '',
    				'placeholder' => '',
    				'prepend' => '',
    				'append' => '',
    				'maxlength' => '',
    				'readonly' => 0,
    				'disabled' => 0,
    			),...

    any ideas?

  • You can’t change the label of a flexible content layout dynamically each time the layout is used the way you are looking to.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Dynamic flexible content title’ is closed to new replies.