# Force footer-nav with cookie

**URL:** https://meta.discourse.org/t/force-footer-nav-with-cookie/207687
**Category:** Feature
**Created:** [October 31, 2021, 12:17am UTC](https://meta.discourse.org/t/force-footer-nav-with-cookie/207687 "2021-10-31T00:17:00Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [October 31, 2021, 2:22am UTC](https://meta.discourse.org/t/force-footer-nav-with-cookie/207687/2 "2021-10-31T02:22:15Z")

</div>

Discourse renders that footer based on some conditions. The footer is added here.

[discourse/app/assets/javascripts/discourse/app/templates/application.hbs at a0bbc346cb5d5b89d1a3efdfa89869349a8b067f · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/a0bbc346cb5d5b89d1a3efdfa89869349a8b067f/app/assets/javascripts/discourse/app/templates/application.hbs#L39-L41)

`showFooterNav` is defined here.

[discourse/app/assets/javascripts/discourse/app/controllers/application.js at 1472e47aae5bfdfb6fd9abfe89beb186c751f514 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/1472e47aae5bfdfb6fd9abfe89beb186c751f514/app/assets/javascripts/discourse/app/controllers/application.js#L25-L28)

If either of those is true, the nav will be displayed.

`isiOSPWA()` and `isAppWebview()` are defined here

[discourse/app/assets/javascripts/discourse/app/lib/utilities.js at 1472e47aae5bfdfb6fd9abfe89beb186c751f514 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/1472e47aae5bfdfb6fd9abfe89beb186c751f514/app/assets/javascripts/discourse/app/lib/utilities.js)

For example, `isAppWebview()` looks like this.

[discourse/app/assets/javascripts/discourse/app/lib/utilities.js at 1472e47aae5bfdfb6fd9abfe89beb186c751f514 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/1472e47aae5bfdfb6fd9abfe89beb186c751f514/app/assets/javascripts/discourse/app/lib/utilities.js#L451-L453)

You can create an additional condition in your theme - in your Discourse site - to check for the cookie, like so

```javascript
const isWKWebView = () => {
  // check for the cookie and return true if it exists
  // or use any other method to detect if the user is using your application
}

```

For other Classes, you would normally then be able to modify the `showFooterNav()` like so

```javascript
api.modifyClass("controller:application", {
  pluginId: "show-footer-nav",
  @discourseComputed
  showFooterNav() {
    // ...
  }
});

```

However, this is the application controller, which means that it will be cached before your code gets a chance to execute. In other words, you won’t be able to modify the Class.

That said, you can still change the `showFooterNav` value with something like this.

```xml
<script type="text/discourse-plugin" version="0.8">
  const isWKWebView = () => {
    // check and return your condition
  };

  if (isWKWebView()) {
    const applicationController = api.container.lookup("controller:application");
    applicationController.set("showFooterNav", true);
  }
</script>

```

in the header tab of your theme or in an initializer if you’re using a remote theme.

---

_[View the full topic](https://meta.discourse.org/t/force-footer-nav-with-cookie/207687)._
