Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created December 7, 2011 14:59
Show Gist options
  • Save bastianallgeier/1443115 to your computer and use it in GitHub Desktop.
Save bastianallgeier/1443115 to your computer and use it in GitHub Desktop.
KirbyMadness
<?
$myimageURL = $pages->find('projects')->children()->last()->images()->findByExtension('jpg')->first()->url()
/*
I break that down a bit:
- find the page with the uri projects
- get all children of that page
- get the last child of that set of pages
- find all images for that last page
- filter that list of images by extension and only take jpgs.
- find the first jpg
- return the url of that first jpg
*/
?>
@bastianallgeier
Copy link
Author

For more kirby madness visit: http://getkirby.com/snippets

@mrflix
Copy link

mrflix commented Dec 7, 2011

jKirby ftw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment