Fix for this one-> contemplate cant display 'view' (just 'value') and cant display cck location fields

  1. <h2>
  2. <?php print $node->field_long_group_name[0]['view'] ?>
  3. </h2>
  4. <p>
  5. All mothers  welcome to come to our meetings. Babies are always welcome at our meetings.
  6. <p>
  7. <?php print $node->field_intro[0]['view'] ?>
  8. <h2>
  9. Meeting Information
  10. </h2>
  11. <?php
  12. foreach ((array)$node->field_meeting as $meeting_item) {
  13.   echo "<p>";    
  14.   print $meeting_item['view'];
  15.   echo "<- that is the meeting_item['view']";
  16.   $new_meeting_node = node_load($meeting_item['nid']);
  17.   echo " ";
  18.   print check_plain($new_meeting_node->field_day[0]['value']);
  19.   echo " at ";
  20.   //begin debug code
  21.   print $new_meeting_node->body; echo " ";
  22.   print $new_meeting_node->field_groupname[0]['nid'];  echo " ";
  23.   print $new_meeting_node->field_meetingplacelocation[0]['lid'];
  24.   echo "<p>";
  25.   //the following does not print anything, even through the lid does above!
  26.   print $new_meeting_node->field_meetingplacelocation[0]['view'];
  27.   echo "<- there should be address info there";
  28.   foreach ((array)$new_meeting_node->field_meetingplacelocation as $meetingplacelocation_item) {
  29.     echo "locations";
  30.     //nothing gets printed, not sure what code to write.
  31.     print $meetingplacelocation_item[0]['lid'];
  32.     print $meetingplacelocation_item[0]['name'];
  33.     print $meetingplacelocation_item[0]['street'];  
  34.     print $meetingplacelocation_item['city'];
  35.     print $meetingplacelocation_item['postalcode'];
  36.   }
  37.   //end debug code
  38.  
  39.   //also trouble... why does not ['view'] display? just ['value']
  40.   print check_plain($new_meeting_node->field_instructions[0]['value']);
  41.   if( $new_meeting_node->field_confirm_with_call[0]['value'] ) {
  42.     echo "<p> Please call a Leader to confirm the day, time and location.";
  43.   }
  44. }
  45. ?>
  46. <h2>
  47. Leader Information
  48. </h2>
  49. <p>
  50. Leaders are experienced mothers. They are available by phone whenever you have breastfeeding questions or concerns.
  51. <ul>
  52. <?php
  53. foreach ((array)$node->field_leader as $leader_item) {
  54.   echo "<li>";    
  55.   print $leader_item['view'];
  56.   echo " ";
  57.   $new_leader_node = user_load($leader_item['uid']);
  58.   foreach ((array)$new_leader_node->field_leaderdisplayname as $displayname_item) {
  59.        print check_plain($displayname_item['value']);
  60.      }
  61.   echo " ";
  62.   if (strcmp($new_leader_node->field_displaythephone[0]['view'],"all")) {
  63.      echo "yes display the phone: ";
  64.      foreach ((array)$new_leader_node->field_myphone as $myphone_item) {
  65.        print check_plain($myphone_item['value']);
  66.      }  echo " ";
  67.   } else {
  68.     echo "dont display the phone. ";
  69.   }
  70.   if (strcmp($new_leader_node->field_displaytheemail[0]['view'],"all")) {
  71.     echo "yes display the email: ";
  72.     foreach ((array)$new_leader_node->field_email as $email_item) {
  73.        print check_plain($email_item['email']);
  74.      }
  75.   } else {
  76.     echo "dont display the email. ";
  77.   }
  78. }
  79. ?>
  80. </ul>
  81. <center><blockquote>
  82. This Web page is maintained by
  83. for
  84. <?php print $node->field_long_group_name[0]['view'] ?>
  85. . Feedback welcome.
  86. </blockquote>
  87. </center>

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.