Page list by city

8 posts by 3 authors in: Forums > CMS Builder
Last Post: October 26, 2012   (RSS)

I have done this many before seems like this cms version is different .....trying to get city pages -this lists all the cities not just Gilbert

http://mesaverderentals.com/2012/RentalList.php?City=Gilbert

and when I stick a "where" in a gilbert only page it I get nothing .. not sticking it in there I get everything like above link

// load records from 'rentals'
list($rentalsRecords, $rentalsMetaData) = getRecords(array(
'tableName' => 'rentals',
'loadUploads' => true,
'allowSearch' => false,
'where' => "City = 'Gilbert'",
));

http://mesaverderentals.com/2012/GilbertRentalList.php?City=Gilbert

Please help.

and can you tell me whats the differnce between

City:values and City:lables??????? First time seeing these.



thanks
Patricia

www.thenetgirl.com

Re: [thenetgirl] Page list by city

Hi,

Just a guess...

If you're pulling list values from a database using the record number 'num' field for option values and a text field for option labels, you may have to add the pseudo field 'your_field:label' to your filter, instead of just 'your_field' so that it returns a text value instead of a number.

Use <?php showme($record['your_field']);exit; ?>

And in your list records call, 'debugSql' => true,

to help see what's going on.

Good luck,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [greg] Page list by city

By thenetgirl - October 26, 2012 - edited: October 26, 2012

Oh that didnt work at all

// load records from 'rentals'
list($rentalsRecords, $rentalsMetaData) = getRecords(array(
'tableName' => 'rentals',
'loadUploads' => true,
'allowSearch' => false,
));


http://mesaverderentals.com/2012/GilbertRentalList.php?City=Gilbert



this is the code City is correct

<b>Record Detail</b><br/>
Record Number: <?php echo htmlencode($detailRecord['num']) ?><br/>
Move In (value): <?php echo $detailRecord['move_in'] ?><br/>
Move In (label): <?php echo $detailRecord['move_in:label'] ?><br/>
Move In Pending : <?php echo htmlencode($detailRecord['move_in_pending']) ?><br/>
NOTICE: <?php echo htmlencode($detailRecord['notice']) ?><br/>
Cross Street: <?php echo htmlencode($detailRecord['cross_street']) ?><br/>
Map Link: <?php echo htmlencode($detailRecord['map_link']) ?><br/>
Address: <?php echo htmlencode($detailRecord['address']) ?><br/>
City (values): <?php echo join(', ', $detailRecord['City:values']); ?><br/>
City (labels): <?php echo join(', ', $detailRecord['City:labels']); ?><br/>
State: <?php echo htmlencode($detailRecord['state']) ?><br/>
Zip: <?php echo htmlencode($detailRecord['zip']) ?><br/>
Bedroom (value): <?php echo $detailRecord['bedroom'] ?><br/>

attached the file

thanks
Patricia

www.thenetgirl.com
Attachments:

gilbertrentallist.php 4K

Re: [gkornbluth] Page list by city

Not trying to use record number just trying to ge the cities to each have there own page.
Patricia

www.thenetgirl.com

Re: [thenetgirl] Page list by city

Not sure, but wouldn't allowSearch' => false, stop the city value from being searched?
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [thenetgirl] Page list by city

Hi,

I notice that you have 'allowSearch' set to false on the example getRecords function you have given us, have you got it set to true on GilbertRentalList.php?

If that isn't the problem, would it be possible for you to attach the GilbertRentalList.php file to a post so I can have a look at it in more detail?

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Page list by city

Perfect --set to true

and removed

showme($rentalsRecords[0]);
Patricia

www.thenetgirl.com