getkirby/kirby — pull request #85 by dweidner (2014-10-07 09:20:22+00:00)
Title: Convert structure field types to page collections

I found your snippet for related pages in the [documentation](http://v2.getkirby.com/docs/solutions/blog/related-articles) and was searching for a way to allow users to add a list of pages within the panel.

Therefor the structure field type looks like a perfect fit.

Example blueprint definition for a related page structure:
```yaml
related:
label: Related Posts
type: structure
entry: >
{{title}} ({{uri}})
fields:
title:
label: Title
type: text
uri:
label: Post
type: page
```

Example for related post entries in the content file:

```yaml
----
Related:
-
title: Related Post A
uri: blog/post-a
-
title: Related Post B
uri: blog/post-b
----
```

Unfortunately the `pages()` function on the field does only convert plain lists of URIs to a collection of page objects. With this addition structures like the described one would be converted as well, as long as `uri` is used as field name.