Posted By

ryarwood on 06/09/11


Tagged

table query ExpressionEngine


Versions (?)

ExpressionEngine Alternating Rows Table


 / Published in: PHP
 

  1. <?php $oddOrEven = "odd"; ?>
  2. {exp:channel:entries channel="office-vacancies" dynamic="no" category="{segment_3_category_id}"}
  3. <tr class="<?php echo($oddOrEven); ?>">
  4. <td>{title}</td>
  5. <td>{office-floor}</td>
  6. <td>{office-sqft}</td>
  7. <td>{office-rent}</td>
  8. <td>{office-type}</td>
  9. <td style="text-align: center">{if "{office-floorplan}" != ""}<a href="{office-floorplan}" target="_blank"><img src="/img/pdf.gif" /></a>{/if}</td>
  10. </tr>
  11.  
  12. {if no_results}
  13. <tr class="odd">
  14. <td>None</td>
  15. <td></td>
  16. <td></td>
  17. <td></td>
  18. <td></td>
  19. <td></td>
  20. </tr>
  21. {/if}
  22.  
  23. <?php
  24. if ($oddOrEven == "odd") {
  25. $oddOrEven = "even";
  26. } else {
  27. $oddOrEven = "odd";
  28. }
  29. ?>
  30. {/exp:channel:entries}

Report this snippet  

You need to login to post a comment.