Need if then statement for filtering

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 14, 2017   (RSS)

By ross - March 13, 2017

Hi there.

Thanks for posting.

What I'd like to start out with is confirming that you are actually uploading the PDF's to records in your "brands" section.

I see that you load that at the top of your page ($brandsRecords).

If I am on the right track here, the logic will be something along these lines:

<?php foreach ($brandsRecords as $brand): ?>
<?php if ($brand['pdf']): ?>
DISPLAY DOWNLOAD LINK
<?php endif ?>
<?php endforeach; ?>

Keep in mind that this is a really basic overview of the code you'll need to use so there will likely be adjustments.

Do you at least get the idea of what I am aiming or here?

Basically, I am looping through each record from the "brands" table and seeing if a file has been uploaded to it.  Note that I am assuming your upload field is called "pdf".

Let me know any questions.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/

By dccreatives - March 14, 2017

Thanks. I worked with the code and it works perfectly. After I called all the records. I added the extra if statement as if the record has a quickship, it should show and that worked nicely. I dont have all the extra products only the ones with the record. Thanks.

By ross - March 14, 2017

Great! 

I'm glad that worked. 

Let me know if you need a hand with anything else.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/