I have a function which returns a facebook wall feed. The data comes back fine but the point i'm having an issue with is combining the list children with the list array.
I start out by defining the list without children.
$row = array(
'item_list' => array(
'#theme' => 'item_list',
'#attributes' => array(
'class' => array('wall-post-list')
),
)
);
After that i jump in to a foreach loop which i'll omit for clarity since it's large. First i create a container which will be inside the li of the list and then stuff that container with children like i did with 'account_link' which will be rendered as #markup FAPI elements.
$list_items[$interation]['data'] = array(
'#theme' => 'container',
'#attributes' => array(
'id' => array($post['id']),
'class' => array('wall-post-content', $post['type']),
),
'account_link' => array(
'#markup' => l('<img class="user" src="http://graph.facebook.com/'. $post['from']['id'] . '/picture" />','http://facebook.com/' . $post['from']['id'], array(
'attributes' => array(
'class' => array('picture'),
'target' => '_blank',
),
'html' => TRUE,
))
),
);
So after building up what this list item is going to have in it I take the $list_items and stuff them into $row['#items']. And now this is where my issue is. The array looks perfect almost to perfect... And when it renders to the page i get
<li>Array</li>
Is there some issue with my approach? or does theme_item_list not render out the children of a li and if so how can I get this to render recursively through the whole array?
Full function code here http://pastebin.com/dr3b4CTX
Correction: seems i was using #theme rather than #type in this situation.