Re: [AlanMacDonald] Property Types with Subtypes, "We also have ..."
OK, I've got the first one myself, managed to get the property type.
// locate in the property_types category, the property type of the
// current record.
list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'property_types',
'selectedCategoryNum' => $propertiesRecord['property_type'],
'categoryFormat' => 'showall', // showall, onelevel, twolevel
));
...
Property Type: <?php echo $selectedCategory['name'] ?>
but when I try similar code for the location, it does not work
list($locationsRecords, $locationsMetaData) = getRecords(array(
'tableName' => 'locations',
'where' => $propertiesRecord['location'],
'limit' => '1',
));
$locationsRecord = @$locationsRecords[0];
...
Location: <?php echo $locationsRecord['title'] ?>
Basically, each property has a location, the locations are set up as a multi-record. I know the number of the location for the current property, n, so how do I get the n'th record on the locations multi-record?
I'm sure it's simple, I just can't get my head around it.