Default Viewer Record
6 posts by 3 authors in: Forums > CMS Builder
Last Post: June 2, 2010 (RSS)
By mark99 - May 27, 2010 - edited: May 27, 2010
Now I have one minor problem, everybody who gets to these detail pages comes from a list that uses manually constructed links, for example one list might send an individual product to.. Example_Detail.php?Cameras-5 (productname-record num). But if you try to view Example_Detail.php by itself then it will always display record number 1 and I'd rather the page just returned "no record" or something if that happens.
Now I can at least limit the records to be category specific by doing this at the top:
// 'where' => whereRecordNumberInUrl(1),
'where' => " category LIKE '%Consumer Cameras%' ",
But then it just display the first record associated with that category instead, by default.
Re: [mark99] Default Viewer Recorder
By mark99 - May 27, 2010
Re: [mark99] Default Viewer Record
By Dave - May 27, 2010
Try this:
'where' => whereRecordNumberInUrl(0),
The value in the brackets is what's used if no number is found in the url. So 0 means match nothing.
Hope that helps!
interactivetools.com
Re: [Dave] Default Viewer Record
By mark99 - May 29, 2010
However, when I went to reload the page again it then started displaying standard browser error 404 (page not found) errors. The viewer would of course still work with a correct detail.php?TITLE-NUM call but now I'd just get 404's if you went to detail.php directly. Is that as intended? The 404's vanish, understandably, when you add '1' back into that line.
Re: [mark99] Default Viewer Record
By Jason - May 31, 2010
Could you provide a link to the page in question so I can see what's happening?
Thanks.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Default Viewer Record
By mark99 - June 2, 2010
if (!$isp_listRecord) {
// header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}