How to: Cross-Related Sections

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 30, 2010   (RSS)

Re: [zip222] How to: Cross-Related Sections

By Jason - September 30, 2010

Hi,

How this will work will depend on what you're storing as the value for your director's list field. Most likely, you're using the num field from the directors table. In that case, when you're displaying your department information, you'll have the record number of the director. You can then simple use another query to get all their information.

EXAMPLE
(note, this example is assuming that you're using a variable called $department to output your department information. You may need to change some name to make it match what you have in your database on your page)

list($directorRecord,$directorMetaData)=getRecords(array(
'tableName' => 'directors',
'allowSearch' => false,
'limit' => 1,
'where' => "num =".intval($department['director']),
));
$director = $directorRecord[0];


So you'll have the variable $director that has the information from your director record.

Hope that gets you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/