[FX.php List] Displaying related records

Dale Bengston dbengston at tds.net
Mon Jul 21 22:08:52 MDT 2008


Us too. We stopped using portals on layouts (except when completely  
unavoidable) back with CDML. Much snappier to make a separate query  
for portal data.

Dale

On Jul 21, 2008, at 10:04 PM, Bob Patin/Longterm Solutions wrote:

> Of course you're right, I wasn't thinking.
>
> I agree with Tim though; I'd go to the related table. I never put  
> portals on web layouts; instead, as he said, I go to the related  
> table, pull the other records... which explains why I didn't  
> remember I had to use nested FOREACHes.
>
> BP
>
>
> On Jul 21, 2008, at 9:51 PM, Jonathan Schwartz wrote:
>
>> Do believe that you are right.
>>
>> Any way, I just thought that I was missing the boat by issuing two  
>> separate queries instead of using the single query.
>>
>> Guess not.
>>
>> I'm going back to the multiple query method.  It's a sure thing.
>>
>> Thanks
>>
>> Jonathan
>>
>> At 12:32 PM +1000 7/22/08, Tim 'Webko' Booth wrote:
>>> On 22/07/2008, at 12:24 PM, Bob Patin/Longterm Solutions wrote:
>>>
>>>> Here's how I'd write it:
>>>>
>>>> foreach($searchResult['data'] as $key => $value) {
>>>> 	echo  $value['off_FEATURE::Headline'][0];
>>>> }
>>>>
>>>> You don't need that internal FOREACH.
>>>
>>> Won't that only get you the first related record for each parent  
>>> record??
>>>
>>> If you really want to use a portal for this, knowing how many  
>>> lines there is useful, then you can:
>>>
>>> for($i=0; $i<$lineitemCount; $i++) {
>>> 	echo $value['off_FEATURE::Headline'][$i];
>>> }
>>>
>>> (Written of the top of my head - that $i = 0 might have to be -1  
>>> maybe...)
>>> Cheers
>>>
>>> Webko
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> -- 
>> Jonathan Schwartz
>> Exit 445 Group
>> jonathan at exit445.com
>> http://www.exit445.com
>> 415-370-5011
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list