Multi record sections: Get record # from end of url. eg: viewer.php?record_title-3

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 9, 2015   (RSS)

By Dave - March 8, 2015

Hi Kenny, 

Try creating a pair of viewers like this in the code generator: 

  • Code Generator > List Page > (just use default options) > save as recommended filename, eg: yoursection-list.php
  • Code Generator > Detail Page > Select "Multi Record Section" > save as recommended filename, eg: yoursection-detail.php
  • Note the instructions on the last page will tell you to update "viewer urls", which can be found under: Admin > Section Editors > Your Section > Viewer Urls (tab)
  • Add the full url for "List Page Url" and "Detail Page Url".

How it works is the "list" viewer shows a list of all the records.  And the detail page shows information on a specific record.  

For an example of this take a look at our showcase.  Here's a list viewer page: 
https://www.interactivetools.com/showcase/index.php

And here's a detail viewer page that it links to: 
https://www.interactivetools.com/showcase/detail.php?Confluence-179

There's lots of other interesting things you can do, including making search engines really quickly ( http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html ) but that's the basics.  

Hope that helps, let me know any questions.

Dave Edis - Senior Developer
interactivetools.com

By Twocans - March 9, 2015

thanks dave,

This is what I have always known as a master detail. aka what you call the list page we call it the master page.

at the end of the day what I was trying to do with the code generator is create joins or join 4 tables together, I had my primary key of the parent table was akin to the foreign keys for the other tables. All in all I will just just hand coding in dreamweaver, 

regards

kenny

By Dave - March 9, 2015

Hi Kenny, 

Yea, for multi-table joins and things like that you'll still need to code things by hand (that's what we do), but for simpler sections (news releases, blog posts, etc) the code generator can save a lot of time.  Also it will load "labels" from related tables.  But ,as I say, for more complex joins you're going to need to do that by hand still.

Cheers!

Dave Edis - Senior Developer
interactivetools.com