# Page field settings

**URL:** <https://forum.getkirby.com/t/page-field-settings/536>\
**Category:** Questions\
**Tags:** v2\
**Created:** [March 20, 2015, 10:07am UTC](https://forum.getkirby.com/t/page-field-settings/536 "2015-03-20T10:07:22Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [June 13, 2016, 7:38pm UTC](https://forum.getkirby.com/t/page-field-settings/536/13 "2016-06-13T19:38:10Z")

</div>

Sure!

You can create a new field in `site/fields/subpage/subpage.php` with the following content:

```auto
<?php

class SubpageField extends PageField {

  public function input() {

    $input = parent::input();
    $input->data(array(
      'field' => 'autocomplete',
      'url' => purl($this->model, 'field/' . $this->name . '/subpage/autocomplete/' . $this->parent())
    ));

    return $input;

  }
  
  public function routes() {

    return array(
      array(
        'pattern' => 'autocomplete/(:all)',
        'method' => 'post',
        'action' => function($parent) {
          $ids = page($parent)->children()->pluck('id');
          
          return response::json(array('data' => $ids));
        }
      )
    );

  }

}

```

You can then use this in your blueprint:

```auto
page:
  label: Page
  type: subpage
  parent: my/parent/page

```

Let me know if that works.

* * *

I have created a [feature request issue on GitHub](https://github.com/getkirby/panel/issues/868) about integrating something like this into the core page field.

---

_[View the full topic](https://forum.getkirby.com/t/page-field-settings/536)._
