Forums

Display custom message if no records are found.

allanbeth 23 Oct, 2013
Hi all,

I have searched the CC forum and cant seem to find the answer to my issue.

Quite simple really, i would like to display a message to the user when there are no records found?

Thanks

Allan
GreyHead 25 Oct, 2013
1 Likes
Hi allanbeth,

I've done this before with a Custom Listing in CC by counting the records and then showing a message if there aren't any. A simple version looks a bit like this:

Header code:
$row_count = 0;

Body code:
$row_count++;
(this code was also used to set the row CSS to give an alternating shaded row display)
Footer code:
if ( $row_count <= 0 ) {
  // show message
}

Bob
allanbeth 08 Nov, 2013
Thanks for the info!

Much appreciated

Allan
This topic is locked and no more replies can be posted.