Answers.Body: <p><code>$entry-&gt;featuredImage[0]-&gt;getUrl('small');</code> works.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T12:26:19.977Z
Answers.LastActivityDate: 2016-05-12T16:52:52.857Z
Answers.LastEditDate: 2016-05-12T16:52:52.857Z
Answers.UserDisplayName: Jamie
Body: <p>I’m using Craft to add CMS functionality to an e-commerce website via <code>craft/app/bootstrap.php</code></p>
  
  <p>Trying to pull a 'timeline' structure with a <code>featuredImage</code> Asset Field. </p>
  
  <p>This code works and pulls the full size image, but I can’t work out how to pull the ‘small’ size of image which is set up as a transform.</p>
  
  <p>I assume it should be something like <code>$entry-&gt;featuredImage[0]-&gt;url['small']</code> but nothing seems to be working. </p>
  
  <p>Any help appreciated.</p>
  
  <pre><code>$timeline = Craft\craft()-&gt;elements-&gt;getCriteria(Craft\ElementType::Entry);
  $timeline-&gt;section = 'timeline';
  $timeline-&gt;with = 'featuredImage';
  $timeline-&gt;withTransforms = 'small';
  
  foreach ($timeline as $entry)
  {                       
    ?&gt;
        &lt;li&gt;
            &lt;div class="imgholder"&gt;&lt;img src="&lt;?php echo $entry-&gt;featuredImage[0]-&gt;url; ?&gt;" alt="&lt;?php echo $entry-&gt;featuredImage[0]-&gt;title; ?&gt;"/&gt;&lt;/div&gt;
            &lt;h4&gt;&lt;?php echo $entry-&gt;title; ?&gt;&lt;/h4&gt;
            &lt;?php echo $entry-&gt;body; ?&gt;
         &lt;/li&gt;
    &lt;?php
  }   
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-12T01:21:50.877Z
Comments.Text: Completely untested so adding as a comment, but try: `echo $entry->featuredImage[0]->getUrl('small');`
Comments.UserDisplayName: Brad Bell
Tags: <image-transforms><php><image><bootstrap-craft>
Title: PHP transformed image?
ThreadText: # PHP transformed image?
  
  (Asked by: username_0 on 2016-05-11)
  
  I’m using Craft to add CMS functionality to an e-commerce website via `craft/app/bootstrap.php`
  
  Trying to pull a 'timeline' structure with a `featuredImage` Asset Field.
  
  This code works and pulls the full size image, but I can’t work out how to pull the ‘small’ size of image which is set up as a transform.
  
  I assume it should be something like `$entry->featuredImage[0]->url['small']` but nothing seems to be working.
  
  Any help appreciated.
  
  ```
  $timeline = Craft\craft()->elements->getCriteria(Craft\ElementType::Entry);
  $timeline->section = 'timeline';
  $timeline->with = 'featuredImage';
  $timeline->withTransforms = 'small';
  
  foreach ($timeline as $entry)
  {                       
    ?>
        <li>
            <div class="imgholder"><img src="<?php echo $entry->featuredImage[0]->url; ?>" alt="<?php echo $entry->featuredImage[0]->title; ?>"/></div>
            <h4><?php echo $entry->title; ?></h4>
            <?php echo $entry->body; ?>
         </li>
    <?php
  }   
  
  ```
  
  **Tags:** image-transforms, php, image, bootstrap-craft
  
  > **Comments:**
  > **username_1**: Completely untested so adding as a comment, but try: `echo $entry->featuredImage[0]->getUrl('small');`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-05-12. Score: 3
  
  `$entry->featuredImage[0]->getUrl('small');` works.
  
  
  ---
  
  