Support

Account

Home Forums ACF PRO repeater field in gutenberg possible?

Unread

repeater field in gutenberg possible?

  • Sorry for making new topics i messed it up.. in mine previous.

    Hello, i am struggeling with the repeater field in a gutenberg field. Can some on give me advice of tell me what i am doing wrong? Or is this even possible?

    When i use @if(have_row() etc.. i am not getting the information i want. But i am receiving the information from a else statement.

    I am using sage10 en acf pro.

    blocks/content-sellingpoint.blade.php
    {{--
      Title: SellingPoint
      Description: Selling Points
      Category: formatting
      Icon: table-row-after
      Keywords: sellingpoint quote
      Mode: edit
      Align: left
      PostTypes: page post
      SupportsAlign: left right
      SupportsMode: false
      SupportsMultiple: false
      EnqueueStyle: styles/style.css
      EnqueueScript: scripts/script.js
      EnqueueAssets: path/to/asset
    --}}
    
    @php
      $title = get_sub_field('title');
      $subtext = get_sub_field('subtext');
      $sellingpoint = get_field('sellingpoint');
    
    @endphp
    
    <section class="sellingpoint">
      <div class="container">
        <div class="row">
          @if (have_rows('sellingpoint'))
            @while(have_rows('sellingpoint')) @php (the_row());
              {!! $subtext !!}
    
            @endwhile
    
          @else test
          @endif
        </div>
      </div>
    </section>
    functions.php
    add_action('acf/init', 'my_acf_init');
    function my_acf_init() {
    
    	// check function exists
    	if( function_exists('acf_register_block') ) {
    
        acf_register_block(array(
    			'name'				=> 'sellingpoint',
    			'title'				=> __('Sellingpoint'),
    			'description'		=> __('A custom sellingpoint block.'),
    			'render_callback'	=> 'my_acf_block_render_callback',
    			'category'			=> 'formatting',
    			'icon'				=> 'table-row-after',
    			'keywords'			=> array( 'Sellingpoint', 'selling', 'point' ),
    		));
    	}
    }
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.