Commas and two Detail viewers from one section

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

By fleff - July 29, 2010

It's a real estate website. A property may be offered for rent for the summer and, let's say, annually. If so, the listing should display "Summer, Annual" on the listings page and the details page. My problem is the comma. What I would like is a single field called "Rental Period" that offers a choice of one or more periods: Summer, Seasonal, Annual or Short Term. If more than one period is selected, they should be separated by commas on the viewer page. I've tried the code in the forum for commas but It works with separate fields, not multiple choice in one field. Is there some way of doing this without setting up four fields? I'd like to be able to do a search on the keywords in the single field called Rental Period using a multi-value pulldown or checkboxes.

Also, I am trying to set up the entering of listings so that my client doesn't have to enter the info twice, once in a section for Sales and a second time in a section for Rentals if the property is offered both ways. I have set up a few fields specific to Rentals in a single section for houses (vs. land), and the houses.php and houses_details.php viewer pages work fine for sales. I have also set up a viewer list page called rentals.php to display properties For Rent. That works fine too, but I can't figure out how to get a listing to go from there to a rentals_details.php page instead of the houses_details.php page where the info is different from the For Rent info. Is there some way to do this from a single section?

Thanks for your help,

Farnham

Re: [Jason] Commas and two Detail viewers from one section

By fleff - July 30, 2010

Thanks, Jason. The commas work fine with the code you posted.

As to the the viewer information, I have a Status dropdown field:

For Sale
Sold
For Rent
Rented

Do you mean to apply if statements based on the selected option to show or hide the proper fields for that status on the details page? Sounds good. I'll try it.

Farnham