Fix for Fix for if image is there show it but if video is there, hide the image

  1.  <?php $video = $node->field_hero_video[0]['view']; ?>
  2. <div class="art-Post">
  3.     <div class="art-Post-body">
  4. <div class="art-Post-inner">
  5. <h2 class="art-PostHeader"> <?php echo art_node_title_output($title, $node_url, $page); ?>
  6. </h2>
  7. <div><?php print $date ?></div>
  8. <div class="art-PostContent">
  9.  
  10. <div class="media-block">
  11.         <div class="media-block-header"></div>
  12.                 <div class="media-block-body">
  13.                         <div class="field field-type-filefield field-field-hero-image">
  14.                         <div class="field-items">
  15.  <?php if ($video){ ?>
  16.                         <div class="field-item"><?php print $node->field_hero_image[0]['view'] ?></div>
  17.                                 <div class="image-description"><?php print $node->field_hero_image[0]['data']['description'] ?></div>
  18. <?php } ?>
  19.                         </div>
  20.                         </div>
  21.                          
  22.   <div class="field field-type-filefield field-field-hero-video">                      
  23.  
  24.  <?php if($video) {
  25.         $output = '<h3 class="field-label">Watch the video</h3>';
  26.         $output .= '<div class="field-items">';
  27.         $output .= '<div class="field-item" >' . $node->field_hero_video[0]['view']  . '</div>';
  28.         $output .= '</div>';
  29.         print $output;
  30.  } ?>                  
  31.  </div>
  32.  
  33.  
  34. <div class="field field-type-filefield field-field-hero-audio">                        
  35.         <?php $audio = $node->field_hero_audio[0]['view']; ?>
  36.         <?php if($audio) {
  37.                 $output = '<h3 class="field-label">Hear the story</h3>';
  38.                 $output .= '<div class="field-items">';
  39.                 $output .= '<div class="field-item" >' . $node->field_hero_audio[0]['view']  . '</div>';
  40.                 $output .= '</div>';
  41.         print $output;
  42.         } ?>                   
  43.  </div>
  44.  
  45.                 </div>
  46.         <div class="media-block-footer"></div>
  47. </div>
  48.  
  49. <div class="field field-type-text field-field-hero-description">
  50. <div class="field-items">
  51. <div class="field-item"><?php print $node->field_hero_description[0]['view'] ?></div>
  52. </div>
  53. </div>
  54.  
  55. <div class="become-button">
  56.   <div align="center"><a href="http://everydayhero.org/family-needs"><img src="/sites/all/themes/everydayhero/images/become-a-hero-button.png" width="312" height="36" /></a></div>
  57. </div>
  58.  
  59. </div>
  60. </div>
  61. </div>
  62. </div>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.