Product listing: check two category fields

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 9, 2013   (RSS)

By jjem - July 8, 2013

Hi,

I do have a listing of musical works. On a one page layout, it selects works from different categories ID and put them under subtitles.

For now this is my code (which is working) but I need it to check "categorie2" field each time as well because some works appear in 2 different categories (I made two categories fields in my "works" table).

Thanks for your help

Jeremy

<!-- Musique cordes -->
         <section id="oeuvrescordes">
          <div class="page-header">
          <h3>Cordes</h3>
          </div>
          <?php foreach ($oeuvresRecords as $record): ?>
          <?php if ($record['categorie'] == '12'): ?>
          <h4><?php echo $record['titre'] ?></h4>
          <p><?php echo $record['formation'] ?></p>
          <p><a href="<?php echo $record['_link'] ?>">Détails</a></p>
          <?PHP endif ?>
          <?php endforeach; ?>
          </section>
 <!--section -->
<!-- Musique vents -->
         <section id="oeuvresvents">
          <div class="page-header">
          <h3>Vents</h3>
          </div>
          <?php foreach ($oeuvresRecords as $record): ?>
          <?php if ($record['categorie'] == '13'): ?>
          <h4><?php echo $record['titre'] ?></h4>
          <p><?php echo $record['formation'] ?></p>
          <p><a href="<?php echo $record['_link'] ?>">Détails</a></p>
          <?PHP endif ?>
          <?php endforeach; ?>
          </section>
 <!--section -->
<!-- Musique vents -->
         <section id="oeuvresmixte">
          <div class="page-header">
          <h3>Instruments mixtes</h3>
          </div>
          <?php foreach ($oeuvresRecords as $record): ?>
          <?php if ($record['categorie'] == '14'): ?>
          <h4><?php echo $record['titre'] ?></h4>
          <p><?php echo $record['formation'] ?></p>
          <p><a href="<?php echo $record['_link'] ?>">Détails</a></p>
          <?PHP endif ?>
          <?php endforeach; ?>
          </section>
 <!--section -->

By jjem - July 9, 2013

That's it... thanks a lot.

Jeremy