Re: [Dave] Divide a single list into multiple groups

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 16, 2009   (RSS)

By kovali - April 12, 2009

Hi Dave,

I have a similar problem and don't seem to find the right answer in this forum yet... This is the situation:

I have 2 sections (in the CMS for a real estate website were different Projects are presented each containing different types or amounts of buildings): "Projects" and "Buildings". In the first section "Projects" I can enter a title, description and 1 picture for every new project, then in the 2nd section "Buildings" I can select the projectnames from a dropdown menu, so a building can be divided into one of the previously created projects, and enter other detailed info about the building . This works perfect in the cms, but i have a problem with how to connect the results in the front-end of the website...

The front-end of the website should have following pages:

1. Listing of all Projects (Title - small description - picture - [>Details])
2. Next, clicking on one of the above projects [>Details] link should open a simple overview of all the buildings for that Project, like:
Project Name
Building Name 1 - Price - Rooms - [>Details]
Building Name 2 - Price - Rooms - [>Details]
Building Name 3 - Price - Rooms - [>Details]
...
3. Next, clicking on one of the [>Details] links here should open the complete details page for that building.

As i said before, i don't know how to setup the url's that will connect and open the data from "Projects" to the data of "Buildings", if possible.

Could you get me on the right track with this please ?

Thanks for your help,
Koen

Re: [kovali] Divide a single list into multiple groups

By Dave - April 15, 2009

Hi Koen,

Looks like this post got lost in the shuffle. I'm not sure if you've solved this or not but here's some tips.

Start with a list page that lists all the projects. Let's pretend that's called projectList.php (you can call it whatever you want). Link every project title to the building list page (see next item).

Next, create a list page that lists all the buildings (buildingList.php).

Finally, create a detail page that lists details about a certain building and is linked from the building list page.

Once you get all that working, review the search docs here: http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html and then update the link on projectList.php so it passes the project name as a search term. This will vary based on your field names but might look something like this:

buildingList.php?project=ABC Corp

And you can generate that with some code like this:

buildingList.php?project=<?php echo urlencode($record['project']) ?>

Hope that helps! Let me know how it goes.
Dave Edis - Senior Developer
interactivetools.com

By kovali - April 16, 2009

Hi Dave, many thanks for your help, it's working well the way you showed me!

From the projectList.php, I get the corresponding buildings in buildingsList.php with this code: [font "Verdana"]buildingList.php?project=<?php echo urlencode($record['title']) ?>

[font "Verdana"]One more question pls: Is it possible to show a field from the Projects table in the buildingList.php page? In the Projects table I have 2 fields (title & description), the title field is populated into the Buildings table but the description field isn't. However, I would like to show the full (project)description in the buildingList.php, like this:

[font "Verdana"]PROJECT ABC Corp (From Buildings table: "Title" is populated in Buildings table from Projects table)
[font "Verdana"]Full Project Description Here (From Projects table)
[font "Verdana"]Building 1 - ... (From Buildings table)
Building 2 - ... (From Buildings table)
Building 3 - ... (From Buildings table)


[font "Verdana"]Koen