Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Display "No Records Found" Message

 

 


kcallana
User

Mar 31, 2008, 6:59 AM

Post #1 of 6 (455 views)
Shortcut
Display "No Records Found" Message Can't Post

I want to have a photo pop into the spot if there is nothing filled in on cms fields, is this possible? Right now it doesn't even come up with the "No records Foun", what have I done wrong? Here is the page http://www.lorenzos.net it is the Holiday Specials Section in the lower right.



Thanks!


Dave
Staff / Moderator


Mar 31, 2008, 4:24 PM

Post #2 of 6 (445 views)
Shortcut
Re: [kcallana] Display "No Records Found" Message [In reply to] Can't Post

No problem, just put your image tag where the "no records found" text is. The code should look like this:


Code
<?php if ($listDetails['noRecordsFound']): ?> 
No records were found!<br/>
(but replace this with your image tag!)
<?php endif ?>


If that's not working attach your viewer file and I can look at the code for you.

Hope that helps! :)

Dave Edis - Senior Developer
interactivetools.com


kcallana
User

Apr 6, 2008, 4:48 AM

Post #3 of 6 (408 views)
Shortcut
Re: [Dave] Display "No Records Found" Message [In reply to] Can't Post

my code is

<?php endif ?>
<?php if (empty($record)): ?>
<!-- Display "No Records Found" Message -->
<img src="/images/holiday.png">
<?php endif ?>



not<?php if ($listDetails['noRecordsFound']): ?>
No records were found!<br/>
(but replace this with your image tag!)
<?php endif ?>



the page is www.lorenzos.net/index.php


Dave
Staff / Moderator


Apr 6, 2008, 7:54 AM

Post #4 of 6 (405 views)
Shortcut
Re: [kcallana] Display "No Records Found" Message [In reply to] Can't Post

Is Holiday Specials a single record or a list of pages? If it's a list of pages you may want to use the list viewer code.

If you could attach the file for index.php I could look at the viewer code and try and spot the problem.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


kcallana
User

Apr 7, 2008, 3:40 AM

Post #5 of 6 (399 views)
Shortcut
Re: [Dave] Display "No Records Found" Message [In reply to] Can't Post

holiday specials is a single page.

index.php is attached

thanks!
Attachments: index.php (19.7 KB)


Dave
Staff / Moderator


Apr 8, 2008, 9:48 AM

Post #6 of 6 (369 views)
Shortcut
Re: [kcallana] Display "No Records Found" Message [In reply to] Can't Post

Hi Kim,

Ok, so since the holiday specials section is a single-page section there will always be a record. So what we need to test is if one of your other fields is defined.

So we can use a PHP if statement for that and || which means "or". So I added this code:


Code
<?php if ($record['title'] || $record['title_2'] || $record['title_3'] || $record['title_4']): ?> 

... holiday specials are displayed here ...

<?php else: ?>
<img src="/images/holiday.png">
<?php endif ?>


Which basically means if any of those fields (title, title_2, title_3, title_4 isn't blank then show the holiday specials, otherwise they must all be blank so slow the holiday.png image which says check back another time.

You can see the page here (I didn't want to modify your original):
http://lorenzos.net/index2.php

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4