Skip to content

Instantly share code, notes, and snippets.

@niklausgerber
Created March 6, 2012 10:20
Show Gist options
  • Save niklausgerber/1985555 to your computer and use it in GitHub Desktop.
Save niklausgerber/1985555 to your computer and use it in GitHub Desktop.
Show Images
<img src="<?php $image = $article->images()->find('thumb.gif') ?><?php echo $image->url() ?>"> //that works
<img src="<?php $image = $article->images()->find('thumb.gif') ?><?php echo thumb($img, array('width' => 200), false); ?>"> //and this does not
<div class="grid">
<div class="row">
<div class="slot-0-1">
<div class="center">
<a href="#"><img src="http://placehold.it/400x300"></a> //should show an image linking to the latest article. Image is called thumb.png sitting in the article folder.
</div>
</div>
<div class="slot-2-3">
<div class="center">
<a href="#"><img src="http://placehold.it/400x300"></a> //should show an image linking to the second latest article. Image is called thumb.png sitting in the article folder.
</div>
</div>
<div class="slot-4-5">
<div class="center">
<a href="#"><img src="http://placehold.it/400x300"></a> //should show an image linking to the third latest article. Image is called thumb.png sitting in the article folder.
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment