<div dir="ltr">Thanks.. I will look into those options and see if I can get there..<br><div class="gmail_extra"><br><br><div class="gmail_quote">On 28 May 2013 14:14, Lucas D Hedding <span dir="ltr">&lt;<a href="mailto:lucashedding@gmail.com" target="_blank">lucashedding@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If don&#39;t mind trying something new, I&#39;d recommend using entity_metadata_wrapper from the entity API.<div>
<br></div><div>Here&#39;s a <a href="http://www.appnovation.com/part_2_entity_metadata_wrappers_and_entity_api" target="_blank">specific example</a> using field collections and a more <a href="https://drupal.org/node/1021556" target="_blank">general example</a>. I&#39;ve found entity_metadata_wrapper to be much easier than dealing with <span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,0,187)">$node</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,119,0)">-&gt;</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,0,187)">field_foo</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,119,0)">[</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,0,187)">LANGUAGE_NONE</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,119,0)">][</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,0,187)">0</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,119,0)">][</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(221,0,0)">&#39;value&#39;</span><span style="border:0px;background-color:rgb(246,246,242);font-size:11.818181991577148px;margin:0px;padding:0px;vertical-align:baseline;font-family:&#39;Bitstream Vera Sans Mono&#39;,Monaco,&#39;Lucida Console&#39;,monospace;line-height:17.99715805053711px;white-space:pre-wrap;color:rgb(0,119,0)">] </span>all over the place. Place a dependency on entity in your .info file and have fun.</div>


</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><br></div>Lucas<div><a href="http://www.mtechinformationsolutions.com" target="_blank">MTech, LLC</a></div></div></div>
<br><br><div class="gmail_quote"><div><div class="h5">On Tue, May 28, 2013 at 7:59 AM, Nancy Wichmann <span dir="ltr">&lt;<a href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">

<div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif"><div><span>Here&#39;s some code I use for dealing with collections. Perhaps it will help you to solve you problem.</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><span style="color:rgb(0,0,255)"><span style="font-size:13px"><span style="font-family:Courier New,courier,monaco,monospace,sans-serif">  $collection = field_get_items($entity_type, $entity, &#39;field_consultant_cost_breakout&#39;);<br>


  $count = count($collection);<br><br>  $total = 0;<br>  for ($i = 0; $i &lt; $count; ++$i) {<br>    // Entity_load will return an array with the entity number as the key.<br>    $item = array_pop(entity_load(&#39;field_collection_item&#39;,
 array($entity-&gt;field_consultant_cost_breakout[LANGUAGE_NONE][$i][&#39;value&#39;])));<br>    $total += $item-&gt;field_total_cost[LANGUAGE_NONE][0][&#39;value&#39;];<br>  }</span></span><br></span><br></span></div><div>


 </div><div><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><b>Nancy</b></i></font> <br></div><div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div>


<div><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;margin-top:5px;padding-left:5px">  <div style="font-family:arial,helvetica,sans-serif;font-size:12pt"> <div style="font-family:times new roman,new york,times,serif;font-size:12pt">


 <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold">From:</span></b> Wipe_Out &lt;<a href="mailto:wipe_out@users.sourceforge.net" target="_blank">wipe_out@users.sourceforge.net</a>&gt;<br>


 <b><span style="font-weight:bold">To:</span></b> <a href="mailto:support@drupal.org" target="_blank">support@drupal.org</a> <br> <b><span style="font-weight:bold">Sent:</span></b> Tuesday, May 28, 2013 6:05 AM<br> <b><span style="font-weight:bold">Subject:</span></b> [support] Accessing values in the $node variable..<br>


 </font> </div><div> <div><br>
<div><div dir="ltr">Probably a simple syntax question but as a non-programmer I am battling with it..<div><br></div><div>I have created an &quot;Invoice&quot; content type that uses an entity reference to a &quot;Patient&quot; content type and within that there is a field collection for addresses.. I am trying to get the address in the first item in the field collection..</div>



<div><br></div><div>My guess is that I have to use something like &quot;entity_load&quot; which I will have to work out when I get there but at the moment I can&#39;t work out the syntax for accessing the field collection ID so I can try and load the data for the field collection..<br>


</div></div></div></div> </div></div> </div> </blockquote></div>   </div></div><br></div></div><span class="HOEnZb"><font color="#888888">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></font></span></blockquote></div><br></div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div></div>