This is probably a silly newb question as I've only been using Drupal for about a week - here goes...
I have created a custom image field $field_article_embedded_images
in my content using CKK and thickbox. This field allows multiple values, so that I can have many images for my node
I have a custom text field to enter the text for the node.
What I want to be able to do is embed from the array $field_article_embedded_images individually within the text on the custom text field.
I have set the Input Format for the text field to "PHP Code" and tested that it works ok by putting in a simple print statement, which works ok.
I then added the following code, to display the first image from the array, if there is one:
<?php if ($field_article_embedded_images[0])
{ ?>
<div class="embedded-image"><?php print $field_article_embedded_images[0] ['view']; ?></div>
<div class="field-item"><?php print $field_article_embedded_images[0] ['alt']; ?></div>
<?php } ?>
And it's not picking up the image (I guess because the variable $field_article_embedded_images[0]
does not have a value within the text field.
Here's the output from the Dev render that relates to the image:
field_article_embedded_images
Array
(
[0] => Array
(
[fid] => 26
[title] => car-on-dyno.jpg