Force Mobile Homepage

:information_source: Summary Force a different homepage for users visiting the site from a small viewport (e.g. mobile)
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - tshenry/discourse-force-mobile-homepage · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Currently the default homepage settings found in the admin panel and user preferences apply to both desktop and mobile. This is a very simple theme component that will allow you to specify a different default homepage for the small viewport version of your Discourse forum.

It is important to note that this will force anyone using a small viewport to navigate to the homepage you choose with this theme component. Your users will not be able to override the default homepage for the small viewport context via their user preferences at this point.

Theme Settings

There is one setting that will allow you to set the alternative homepage to one of the following:

  • latest (default)
  • new
  • top
  • categories
  • hot

Potential future work ideas

  • Allow users to override the default set via this component.
57개의 좋아요

Works like a charm. This is great mate!

4개의 좋아요

Great little component, just what I needed for my community!

Many thanks.

1개의 좋아요

Can you please integrate this into core settings.

Sitewide default in settings for mobile and desktop.

And user setting in user profile settings for mobile and desktop.

:wink:

9개의 좋아요

+1 for having different home page capabilities for mobile and desktop in core.

10개의 좋아요

Thank you for this useful component.
Could you please help? While showing “Latest” by default on mobile, there is no option to choose “Categories” in top drop-down menu above topic list.

Exactly what I was after - thank you for this little component!

3개의 좋아요

outstanding, thank you :folded_hands::folded_hands::folded_hands::folded_hands:

1개의 좋아요

Thanks for creating this! :handshake: How about future compatibility as the main Discourse app continues to evolve and is updated? Or is the theme component pretty future-friendly in that regard?

2개의 좋아요

This Theme component is super-simple and pretty much bomb proof I reckon! Just a couple of lines of CSS and HTML with no settings or anything fancy.

3개의 좋아요

I still feel this should be merged into core as an additional setting, it is so utterly useful!

11개의 좋아요

A great and simple little component.

Of course the requests immediately started from our power users that they be allowed to set their own override preference.

This serves the vast vast majority of normal users, but there is still demand for the ability to personally override by the top 1% of power users.

Agreed. It has not been updated in 7 years but still being used by Discourse owners.

1개의 좋아요

이것은 업데이트가 필수인 필수 플러그인 중 하나입니다!:folded_hands:

여기 PR에서 업데이트했습니다: DEV: update to initializer - Pull Request #3 - tshenry/discourse-force-mobile-homepage - GitHub

@tshenry 시간 나실 때 확인해 주시고 병합해 주실 수 있을까요?

7개의 좋아요

병합했습니다! PR 올려주셔서 감사합니다!

8개의 좋아요

브라우저의 개발자 콘솔에서 이 멋진 테마 컴포넌트에 대한 비추천(deprecation) 알림을 받았습니다:

[THEME 50 ‘Force Mobile Homepage’] 비추천 알림: 사이트 초기화 중에 site.mobileView 또는 site.desktopView에 접근하면 브라우저 창 크기가 조정될 때 오류와 일관성 문제가 발생할 수 있습니다. 이러한 확인 로직을 페이지 렌더링 중에 실행되는 컴포넌트, 트랜스포머 또는 API 콜백으로 이동해 주세요. [Discourse 3.5.0.beta9-dev부터 비추천] [deprecation id: discourse.static-viewport-initialization] [info: Designing for Different Devices (Touch & Hover)]

2개의 좋아요

네, 같은 거예요. 제게 남은 유일한 비추천(deprecation) 공지 중 하나네요…

1개의 좋아요

이것도 기능(capabilities) 변경으로 인한 또 다른 피해 사례입니다.

기기 유형에 따라 특정 탐색 경로를 홈페이지로 로드하는 새로운 최선의 방법은 무엇인가요?

6개의 좋아요

@merefield 님이 말씀하신 대로:neutral_face:

2개의 좋아요