Support

Account

Home Forums Feature Requests Flexible Content Titles

Solving

Flexible Content Titles

  • It would be great to have an option to be able set a textfield value as the Flexible Content Title. If you have several Flexible Fields and you collapse them to sort them, its very hard to tell which is which, because they all have the same name. see screenshot.

  • Good suggestion. Would be a huge UI-boost for clients.

  • Found this thread in the forum, with a similar request and a dead link to a possible solution 🙁

    http://support.advancedcustomfields.com/forums/topic/add-unique-name-field-for-flexible-content-field/

  • Thanks. Yeah I think a simple checkbox for a text field saying “use as layout title” would be great. Right now it’s almost useless to sort items when you have 8 or more flexible fields.

  • Hi @theshae and @bjarne

    Thank you guys for the feature request 🙂

    This information has been sent to Elliot for consideration and hopefully this feature will soon see its way into the plugin.

  • Hello, what happened to this feature request?
    My Backend is messy with Flexible Content Elements, too.
    The static titles makes them still unhandleable.

  • For me, I wanted to show the label of the layout and also to show a specific title(based on a custom field – ‘section_title’), so I commented out the
    $title = '';
    added a dash between the name of the layout and it’s description :

    
        //	$title = '';
    	
       
    	// load text sub field
    	if( $text = get_sub_field('section_title') ) {
    		
    		$title .= '<span> - ' . $text . '</span>';
    		
    	}
    	
    	
    	// return
    	return $title;
    	
    }
  • If my ACF is set up as below:

    Field Group : simple_page
    Flexible Content Row : content_rows
    Layout: two_column
    Field inside Layout: Title (text field)

    Would this be the correct way to set this hook out?

    add_filter('acf/fields/flexible_content/layout_title/name=two_column', 'my_acf_fields_flexible_content_layout_title', 10, 4);
    function my_acf_fields_flexible_content_layout_title( $title, $field, $layout, $i ) {
    
    // load text sub field
    	if( $text = get_sub_field('title') ) {
    		
    		$title .= '<span> - ' . $text . '</span>';
    		
    	}
    	
    	
    	// return
    	return $title;
    }

    Thanks in advance.

  • I know that this is an older thread, but you can’t use the layout name in this filter, it only works with field name or field key (belonging to the flex field) https://www.advancedcustomfields.com/resources/acf-fields-flexible_content-layout_title/.
    You can have it dependent on the existing title. For example:

    
    add_filter('acf/fields/flexible_content/layout_title/name=content_rows', 'my_acf_fields_flexible_content_layout_title', 10, 4);
    function my_acf_fields_flexible_content_layout_title( $title, $field, $layout, $i ) {
      // load text sub field
      if( $title == 'Two Column') {
        $text = get_sub_field('title');
        if ($text) {
          $title .= '<span> - ' . $text . '</span>';
        }
      }
      // return
      return $title;
    }
    
Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Flexible Content Titles’ is closed to new replies.