Hi Perch,
So each category record will have a detail page, and the Items will be in a different order on it?
If you had a getRecords function that was retrieving a specific category, you could use its selectItems field to order the data in the items section like this:
// load record from 'category'
list($categories, $categoryMetaData) = getRecords(array(
'tableName' => 'category',
'where' => whereRecordNumberInUrl(0),
'allowSearch' => false,
'limit' => '1',
));
$category= @$categories[0]; // get first record
if (!$category) { dieWith404("Record not found!"); } // show error message if no record found
$itemOrder = $category['selectItems'];
// load records from 'items'
list($items, $itemsMetaData) = getRecords(array(
'tableName' => 'items',
'loadUploads' => true,
'allowSearch' => false,
'orderBy' => "FIELD(num,$itemOrder) DESC"
));
This is just example code, so you'll have to make a few changes to get it working with your site.
So a category is being loaded from a category section and the record is being set against the $category variable. Then the selectItems field variable is set to the $itemOrder variable, and this is used in the orderBy key in the getRecords for the items section.
Cheers!
Greg
Greg Thomas
PHP Programmer - interactivetools.com