drrobotnik
4/15/2015 - 5:03 PM

potential structure

potential structure

::: layout file structure :::

acf/
 layouts/
   carousel-products/
     layout.json
     layout-carousel-products.php
   	 css/
       slick.min.css
       style.css
       ...
     js/
       jquery.min.js
       slick.min.js
       main.js
       ...
     img/
       ...
       ...

   hero-slider/
     layout.json
     layout-hero-slider.php
   	 css/
       slick.min.css
       style.css
       ...
     js/
       jquery.min.js
       slick.min.js
       main.js
       ...
     img/
       ...
       ...


::: layout-carousel-products.php :::

if( !have_rows('carousel_products') )
  return;

wp_enqueue_script('slick');



	// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();

    // display a sub field value
    the_sub_field('sub_field_name');

endwhile;


::: layout-hero-slider.php :::

if( !have_rows('hero_slider') )
  return;

wp_enqueue_script('slick');



	// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();

    // display a sub field value
    the_sub_field('sub_field_name');

endwhile;