Search Results - pull field from another pod?

0

I am performing a search on a pod. This pod 'Business' has a pick column related to another pod 'Special Offers'.

When I get my search results from the pod 'Business', is it possible to display a field from the 'Special Offers' pod? This is a piece of the code to display the results:

<?php
// $where = substr($where, 0, strlen($where) - 4);
if ( isset($_GET['type']) ) {

$Record->search_var = 'search2';  
$Record->findRecords('name ASC', 5, $where );

while ( $Record->fetchRecord()){
    // set our variables
    $Record_name               =   $Record->get_field('name');
    $Record_companylogo     =   $Record->get_field('company_logo');
    $Record_offer              =   $Record->get_field('offer_details','parent.name =\'special_offers\'');

    $Record_companylogo     = $Record_companylogo[0]['guid']; 
    ?>

This is the line I am struggling with, trying to get the field 'offer_details' from the 'special_offers' pod:

$Record_offer              =   $Record->get_field('offer_details','parent.name =\'special_offers\'');

Any help would be great thanks

asked Aug 19 '10 at 12:14

inspiration

7

edited Aug 19 '10 at 1:18

add comment
enter at least 15 characters

1 Answer

0

You should be able to drag any column from related pod. You should use this construction to do this:

$field_from_related_pod = $record->get_field('[relationship column name].[desired column from related pod]');

in your case it should be like this:

$Record_offer = $Record->get_field('offer_details.name'); //'offer_details' is your Business Pod relationship column machine name; 'name' is column machine name from Special Offers Pod you want to get

answered Aug 19 '10 at 8:33

Fike

208

edited Aug 19 '10 at 8:34

add comment
enter at least 15 characters