Custom "listingsRecord not found!" page

5 posts by 3 authors in: Forums > CMS Builder
Last Post: March 4, 2010   (RSS)

Re: [8bit Gamer] Custom "listingsRecord not found!" page

By gkornbluth - March 3, 2010 - edited: March 3, 2010

Hi 8BG.

You should see some code similar to this in your viewer: // show error message if no matching record is found
if (!$your_tableRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}


Just change Record not found! to any text you want to appear. I'm not sure how you would include a link or any styling on that message, but I know that you can accomplish that also. If I find out how, I'll revise this post.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Custom "listingsRecord not found!" page

By Chris - March 3, 2010

Or you can use a redirect:

// redirect to homepage if no matching record is found
if (!$your_tableRecord) {
header("Location: http://www.mysite.com/");
exit;
}


I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Custom "listingsRecord not found!" page

By gkornbluth - March 3, 2010 - edited: March 3, 2010

Thanks Chris

I guess I should have looked at page 40 in my own cookbook.

Best,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [8bit Gamer] Custom "listingsRecord not found!" page

Hi guys! Thanks for the answers. All sorted now :)