Specific records displaying question

5 posts by 4 authors in: Forums > CMS Builder
Last Post: August 22, 2008   (RSS)

Re: [equinox69] Specific records displaying question

By Jake - August 19, 2008

Hi equinox69,

You should be able to set this up using a PHP if statement, like this:

<?php if ($yourRecord['featured_ad'] == "1"): ?>
***Record Display Code here***
<?php endif ?>


All you need to to is adjust that first line so that the correct field name is used, and the "$yourRecord" text is changed to correspond with your section's name.

Let us know how this works out!
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.

Re: [Jake] Specific records displaying question

By johnniefp - August 20, 2008 - edited: August 20, 2008

I'm new to CMSB but have been reading through to docs.

On this page:
http://www.interactivetools.com/docs/cmsbuilder/code_generator.html it shows you can filter results.

Wouldn't you be better off letting MySQL do the filtering? so in the 'Filter Results' textbox you enter 'featured_ad = 1'

edit:
using MySQL filtering assumes you only want 'featured_ad' results so this would only give you a filtered resultset.

Jakes solution will give you all the results and leave the logic up to you as to showing 'featured_ad'.

In short; Jakes solution is more flexible.

Re: [johnniefp] Specific records displaying question

By Dave - August 20, 2008

It depends on what's needed on the page but I think that's another good approach if none of the "non-featured" listings need to be displayed on the page.

Thanks for the suggestion!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Specific records displaying question

By Codee - August 22, 2008

Thanks everyone!