Skip to main content
2 of 3
added 213 characters in body
milkovsky
  • 5.4k
  • 37
  • 59

As far I understood you want render this peace of code

$page_array['photo_gallery_arguments'] = array(
    '#title' => t('All photos from ever'),
    '#items' => $items,
    //Theme hook with suggestion.  
    '#theme' => 'item_list',
    '#type' => 'div',
  );

in series of divs ... So change those peace of code on this:

   foreach($items as $item_key => $item){
      $page_array['photo_gallery_arguments'][$item_key] = array(
        '#type' => 'container',
        '#attributes' => array(
          'class' => array(
            'my-class-' . $item_key,
          ),
        ),
      );
      $page_array['photo_gallery_arguments'][$item_key]['content'] = array(
        '#type' => 'markup',
        '#markup' => $item,
      );
   }

OR another variant with 'markup':

   foreach($items as $item_key => $item){
          $page_array['photo_gallery_arguments'][$item_key] = array(
            '#type' => 'markup',
            '#markup' => '<div class="my-class-"' . $item_key . '>' . $item . '</div>',
          );
    }

OR another variant - divs without classes:

   foreach($items as $item_key => $item){
          $page_array['photo_gallery_arguments'][$item_key] = array(
            '#type' => 'item',
            '#markup' => $item,
          );
    }

P.S. read about Render Arrays , also some elements described at Form API

milkovsky
  • 5.4k
  • 37
  • 59