Turn off Record Number in URL

2 posts by 2 authors in: Forums > CMS Builder
Last Post: July 11, 2011   (RSS)

By sidcam - July 11, 2011

CMSB adds a record number to the end of URL's. Example, the "123" in: "viewer.php?field1_field2-123".

Can that be disabled? (so the url is just "viewer.php?field1_field2"

I have a real estate website and the MLS importing process deletes and repopulates the tables every night. If someone saves a URL with the record number at the end, it's going to be a dead link the next day when the record number changes.

Thanks, Sid

Re: [sidcam] Turn off Record Number in URL

By Dave - July 11, 2011

Hi Sid,

You'll need some kind of unique identifier to pull up the record. Maybe the MLS number? If you have a field named "mls" you could try this:
viewer.php?mls=1234

Or depending on your server CMS also supports an alternate url format as well:
viewer.php/mls-1234/

Both of those use the build in search features described here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

So you'll want to remove the 'where' line like this:
'where' => whereRecordNumberInUrl(1),

And probably add a limit line like this so you don't get more than one record:
'limit' => '1',

Hope that helps (and makes sense!). Let me know any questions.
Dave Edis - Senior Developer
interactivetools.com