Skip to content

Instantly share code, notes, and snippets.

@veryrobert
Created October 18, 2015 12:16
Show Gist options
  • Save veryrobert/b0dae664bfe0e6dacf01 to your computer and use it in GitHub Desktop.
Save veryrobert/b0dae664bfe0e6dacf01 to your computer and use it in GitHub Desktop.
// Using Kirby structure field with a selection field inside for images
<?php foreach($page->structureName()->yaml() as $name) {
$title = $name['fieldNameText'];
$image = $name['fieldNameImage'];
$imageUrl = $page->file($image)->url();
echo html('<h1>'.$title.'</h1><img src="'.$imageUrl.'" alt="'.$title.'">');
}
?>
@veryrobert
Copy link
Author

Using Kirby structure field with a selection field inside for images

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