Hello dear Seblod team and fellow Seblod users,
I love the potential Seblod adds to Joomla, but sometimes I have trouble getting things done.
At this moment I'm really struggling to call groupx values in script fields from the Code Pack. I've created a content (item_content_grp) type with 3 fields (field1, field2 and field3) and I've added a groupx field (item_content) in another content type (item) with content type item_content_grp. Now I want the values of field1 and field2 as arrays in a beforeRender field, but I have been struggling to achieve this for many days.
I get either NULL or array(0) {} as result and the following debug results
Notice: Uninitialized string offset, Notice: Trying to get property of non-object and Warning: Illegal string offset 'field1'.
I followed the instructions by Lionel
here to create the groupx field (field1, field2 and field3 have no storage and groupx has storage custom | article | item[item_content]).
I installed jdump, but so far it didn't help me. I tried creating array this way with the path to the groupx values I found
here:
dump($fields['item_content']);<br>
$array1 = array();<br>
$c = count($fields['item_content']) - 1;<br>
for ($i=0; $i<=$c; $i++) {<br>
$array1 = $fields['item_content']->value[$i]['field1']->value<br>
}<br>
var_dump($array1;
What am I missing? Can anyone help me get this right?
Regards,
Richard