8 years ago
3
Topic

Hello @all,

In one seblod's template, I have 5 groupX.

In backend, it's OK.

But in frontend, I have a problem to display the result of all groupX.
- I used php foreach, and only the first works.
- So I change the order to test where is the problem, and it's always the first "php foreach" works.
- I tried one by one, and they work fine.

The four other groupX/foreach display :
Warning: Invalid argument supplied for foreach() in /home/www/templates/NAME-OF-TEMPLATE/index.php on line XX

Is it possible to used many groupX in one template ?

Thank you

/-- EDIT 15 JULY : CHANGE TITLE POST --/

Get a Book for SEBLOD
8 years ago
0
Level 1

Is there an other way to call groupX in front-end ? instead of foreach ?

8 years ago
1
Level 1

I'm just changing the title of my post, because I think, my php error come from the communication between "groupX" and "dynamic list".

More details :

- I create an "OFF" template with one field : dynamic list, to list article from specific category
- This field is on all view (admin, site, intro, content)

- I create an "OFF" template with one field : dynamic list, to list article from an other specific category

So, I have 2 "OFF" template


- I create an "ON" template, with 2 fields "GroupX" to call 2 "OFF" template.

In my template :

<?php $players = $cck->getValue('players_groupx'); ?>

<?php foreach($players as $content){
$rowIdP= $contentP['players_dynamic_list']->value;
$tableP= JTable::getInstance('Content', 'JTable');
$tableP->load($rowId);
$contentP = JHtml::_('content.prepare', $tableP->introtext);
echo $contentP; }
?>

<?php $fans = $cck->getValue('fans_groupx'); ?>

<?php foreach($fans as $contentF){
$rowIdF= $contentF['fans_dynamic_list']->value;
$tableF= JTable::getInstance('Content', 'JTable');
$tableF->load($rowIdF);
$contentF= JHtml::_('content.prepare', $tableF->introtext);
echo $contentF; }
?>

The first foreach works, but not the second.
If I change the order... same result, only the first works.

How can I do ?

8 years ago
0
Level 2

OK, i try an other way and it works

Get a VIP membership