Created
December 7, 2011 14:59
-
-
Save bastianallgeier/1443115 to your computer and use it in GitHub Desktop.
KirbyMadness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$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 | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more kirby madness visit: http://getkirby.com/snippets