# Multilang page restrict structur field

**URL:** <https://forum.getkirby.com/t/multilang-page-restrict-structur-field/24752>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 17, 2022, 1:43pm UTC](https://forum.getkirby.com/t/multilang-page-restrict-structur-field/24752 "2022-02-17T13:43:55Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 19, 2022, 10:04am UTC](https://forum.getkirby.com/t/multilang-page-restrict-structur-field/24752/21 "2022-02-19T10:04:33Z")

</div>

That might well be, but for `$page->content('en')` etc. to work, you need to define the translations.

Example (shortened):

```auto

<?php

class MembersPage extends Page
{
  public function children()
  {
    $usersPages = [];
    $users = kirby()->users();
    foreach ($users as $key => $user) {
        $content = [
            'title' => $user->username(),
            'role' => $user->role(),
        ];
        $contentEn = [
            'about' => $user->content('en')->about(),
            'dates' => $user->content('en')->dates()->yaml(),
        ];
        $contentDe = [
            'about' => $user->content('de')->about(),
            'dates' => $user->content('de')->dates()->yaml(),
        ];

      $userPages[] = [
        'slug' => Str::slug($user->username()),
        'num' => $user->indexOf($users),
        'template' => 'member',
        'model' => 'member',
        'content' => array_merge($content, $contentEn),
        'translations' => [
            'de' => [
                'code' => 'de',
                'content' => array_merge($content, $contentDe),
            ],
            'en' => [
                'code' => 'en',
                'content' => array_merge($content, $contentEn),
            ],
        ]
      ];
    }
    return Pages::factory($userPages, $this);

  }

}

```

---

_[View the full topic](https://forum.getkirby.com/t/multilang-page-restrict-structur-field/24752)._
