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

Home: Products: CMS Builder:
Simple Checkbox to display panels

 

 


virgodesign
User

Jul 18, 2008, 1:13 PM

Post #1 of 2 (104 views)
Shortcut
Simple Checkbox to display panels Can't Post

Hi Dave,

I have a simple checkbox field in the editor sections to turn on and off the display of info boxes on the web page:

So if the record "info_box_1" is checked for a value of "1" I want to embed some code etc. I think this is most of what I need:

<?php if ($record['info_box_1']): ?>
Do html stuff here if info_box_1 = a value of 1
<?php endif ?>

Thanks Dave
Avrom


Dave
Staff / Moderator


Jul 18, 2008, 3:11 PM

Post #2 of 2 (91 views)
Shortcut
Re: [virgodesign] Simple Checkbox to display panels [In reply to] Can't Post

Hi Avrom,

Yes, that's pretty much it. Give it a try and let me know how it goes.

Some tips for you to help with debugging. If it's not working try printing out the value of the checkbox:

info_box_1: '<?php echo $record['info_box_1']?>'

If it's 0 or 1 you can use the code you have, if it's Yes or No you'll need to test like this:

<?php if ($record['info_box_1'] == 'Yes'): ?>

And if you want to see what all the field values are you can always use this:

<xmp><?php print_r($record) ?></xmp>

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
Hosting
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