# How to default to latest on mobile and categories+latest on desktop?

**URL:** https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716
**Category:** Support
**Created:** [13. Januar 2017 um 18:09 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716 "2017-01-13T18:09:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [13. Januar 2017 um 18:09 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/1 "2017-01-13T18:09:51Z")

</div>

Is there a way to default the frontpage to display latest page on mobile, while on desktop displaying the categories+latest combined view? I’m currently trying to figure this out.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [13. Januar 2017 um 19:56 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/2 "2017-01-13T19:56:53Z")

</div>

No there is no way to do this.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [14. Januar 2017 um 06:50 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/3 "2017-01-14T06:50:28Z")

</div>

Thanks. That’s a bit sad tho as I am finding it frustrating to have to take an extra step to find latest when on mobile and using the discourse app. It tells me I have new posts to read, I select the link and then see not topics but categories. On desktop I am ok with the cat+latest view which my colleagues prefer but on mobile it shows me just cat.

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [14. Januar 2017 um 12:43 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/4 "2017-01-14T12:43:02Z")

</div>

You could do it, if you edit the nginx-settings. We use a nginx reverse proxy, so its no real problem. Its a dirty hack, but works.

```plaintext
    # ---------------------------------------------------------------------------------
    # Redirect Mobile to latest instead to default
    # ---------------------------------------------------------------------------------
        set $mobile_rewrite N;
        if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
               set $mobile_rewrite Y;
        }
        if ( $http_referer !~* "www\.mydomain\.com" ) {
               set $mobile "${mobile_rewrite}E";
        }
        if ($mobile_rewrite = YE) {
               rewrite ^\/$ https://www.mydomain.com/latest redirect;
        }
        if ($http_user_agent ~* '(iPhone|iPod|android|blackberry)') {
             rewrite ^\/$ https://www.mydomain.com/latest permanent;
        }
```

  
This version is shorter and faster, may also work for you. [code] if ($http\_user\_agent ~\* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") { rewrite ^\/$ https://www.mydomain.com/latest redirect; } [/code]

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [14. Januar 2017 um 12:59 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/5 "2017-01-14T12:59:36Z")

</div>

The compromise we reached on our forum was to

- Set categories as the homepage
- On mobile, make the logo link to /latest

That way the categories view is welcoming to potentially new visitors, while regular users are just 1 tap away from the ‘latest’ page.

The suggestion came from somewhere on meta, but I can’t find it right now.

The code we use (in the Mobile “Header” section of CSS/HTML customisation) is

```plaintext
<script type="text/discourse-plugin" version="0.4">
  api.changeWidgetSetting('home-logo', 'href', '/latest')
</script>

```

(on an unrelated note, can json uploads be enabled on meta, so we can share “exported” customisations for others to easily import?)

---

<div class="post-metadata">

### Author: ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)
#### Post date: [14. Januar 2017 um 14:41 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/6 "2017-01-14T14:41:55Z")

</div>

Definitely in favor of a admin setting for

- mobile category page style

To go along with the current setting for

- desktop category page style

Categories+Latest combined view is brilliant for desktop but Latest is key for mobile.

---

<div class="post-metadata">

### Author: ![\_vincent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/_vincent/32/119557_2.png) [@\_vincent](https://meta.discourse.org/u/_vincent)
#### Post date: [8. Oktober 2017 um 10:00 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/8 "2017-10-08T10:00:03Z")

</div>

Bumping this feature request:

> [@scombs](#):
>
> Definitely in favor of a admin setting for
> 
> mobile category page style
> 
> To go along with the current setting for
> 
> desktop category page style
> 
> Categories+Latest combined view is brilliant for desktop but Latest is key for mobile.

Mobile usage is more and more frequent on my community, and I too think the default mobile view is pretty unpleasant when using Categories + Latest as the category page style.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [13. Februar 2018 um 13:16 UTC](https://meta.discourse.org/t/how-to-default-to-latest-on-mobile-and-categories-latest-on-desktop/55716/9 "2018-02-13T13:16:09Z")

</div>

> [@Different landing page for desktop vs mobile theme?](https://meta.discourse.org/t/different-landing-page-for-desktop-vs-mobile-theme/46019):
>
> Is it possible to somehow set a different landing page based on desktop vs mobile? i.e when you’re on mobile you land on /categories while desktop would land on /latest.
