# Reverse if language exists

**URL:** <https://forum.getkirby.com/t/reverse-if-language-exists/11009>\
**Category:** Questions\
**Tags:** v2\
**Created:** [August 9, 2018, 2:11pm UTC](https://forum.getkirby.com/t/reverse-if-language-exists/11009 "2018-08-09T14:11:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonabaptistella](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jonabaptistella/32/5797_2.png) [@jonabaptistella](https://forum.getkirby.com/u/jonabaptistella)\
**Post date:** [August 9, 2018, 2:11pm UTC](https://forum.getkirby.com/t/reverse-if-language-exists/11009/1 "2018-08-09T14:11:36Z")

</div>

Is there anyway to just reverse this code from `exists()` to notExists or something? Did not find anything in the docs.

```auto
<?php
// To show pages that are not translated
pages::$methods['notTranslated'] = function($pages) {
  return $pages->filter(function($page) {
    return $page->content(site()->language()->code())->exists();
  });
};
?>

```

---

<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:** [August 9, 2018, 2:24pm UTC](https://forum.getkirby.com/t/reverse-if-language-exists/11009/2 "2018-08-09T14:24:58Z")

</div>

> [@jonabaptistella](#):
>
> return $page-\>content(site()-\>language()-\>code())-\>exists();

return $page-\>content(site()-\>language()-\>code())-\>exists() === false;

---

<div class="post-metadata">

**Author:** ![jonabaptistella](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jonabaptistella/32/5797_2.png) [@jonabaptistella](https://forum.getkirby.com/u/jonabaptistella)\
**Post date:** [August 9, 2018, 2:26pm UTC](https://forum.getkirby.com/t/reverse-if-language-exists/11009/3 "2018-08-09T14:26:49Z")

</div>

That worked well. Thank you! 😃

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:26pm UTC](https://forum.getkirby.com/t/reverse-if-language-exists/11009/4 "2025-02-06T17:26:33Z")

</div>

Archived on February 6, 2025, 5:26pm UTC


