Pulling in titles to create sub navigation

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 18, 2011   (RSS)

Re: [Kittybiccy] Pulling in titles to create sub navigation

By Jason - May 16, 2011

Hi,

I took a look at your page, and what's happening is your showing the same record for each detail page. To show the correct record for each page, try this:

// load records
list($residentialRecords, $residentialMetaData) = getRecords(array(
'tableName' => 'residential',
'where' => whereRecordNumberInUrl(),
));

$residentialRecord = @$residentialRecords[0]; // get first record


Is that closer to what you're looking for?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Pulling in titles to create sub navigation

By Kittybiccy - May 17, 2011

Hi Jason,

Thanks, I had tried that before but when you then go into a detail page it only displays that record title in the sub navigation:
http://domain3318720.sites.fasthosts.com/portfolio_residentialList.php

I need it to display all of the record titles for that section on each detail page as it does on the list page. Is that possible? Thanks!

Re: [Kittybiccy] Pulling in titles to create sub navigation

By Jason - May 17, 2011

Hi,

I assume that in addition to showing all the titles, you also want to display the details of a given selection. Is that right?

If so, what you can do is have 2 queries: 1 that returns just the selected record, and 1 that returns all of the records.

For example:

// get Detail Record
list($residentialDetailRecord, $residentialDetailMetaData) = getRecords(array(
'tableName' => 'residential',
'where' => whereRecordNumberInUrl(),
));

$residentialDetail = @$residentialDetailRecord[0]; // get first record

// get all records from section
list($residentialRecords, $residentialMetaData) = getRecords(array(
'tableName' => 'residential',
'allowSearch' => false,
));


In this example, you have the variable $residentialDetail that is the individual record that was selected, and $residentialRecords that is all the records in your "residential" section.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Pulling in titles to create sub navigation

By Kittybiccy - May 18, 2011

Brilliant, just what I needed! Thank you [:)]