Different landing page for desktop vs mobile theme?

No worries. I should have linked to instructions here too! There is a nice illustrated set of instructions you can check out here. It’s possible you might be on the latest version of Discourse, in which case the UX for themes and components has changed a little. Let me know if the instructions I linked to still leave you a little lost. I’d be happy to help you figure it out.

By the way, the topic below is the home of this theme component now:

2개의 좋아요

thanks @tshenry i’ll take a look.

however I’ve just fiddled round with the customization settings - I’ve never had an issue before, and now my site has disappeared!! Just produces a blank screen, but the code is there!!

any idea how to reverse changes from the cli???

cheers

You’ll need to go to your site’s safe mode Air Cadet Central and check “disable current theme” then you’ll want to revert whatever change you made in the customizations.

2개의 좋아요

thanks fella - didn’t know that existed! Lifesaver!

1개의 좋아요

OK back up and working - thanks again - I’ve installed your theme and it’s installing as a Theme not a Theme Component??? any ideas. I’m on Version: v2.1.0.beta5 +66

cheers, and thanks for your hard work :smiley:

No problem. If you select it from the list of themes, then scroll down, you should see a section like this:

You’ll want to click the “make component” button then confirm. You should then be able to add it to your main theme the way it’s outlined in the instructions I linked to earlier.

Fab, getting there! Making it a component works, but when I add it to my theme it adds a component with the others but there’s no text for the link, but the (x) button is there. The link it produces ends in a # where the others don’t??
and it doesn’t seem to work!!

Cheers

Ah yeah, I think that might be a little bug that’s still getting worked out. Try refreshing the page, then click the (x) if that blank theme component is still there, then try selecting the Force Mobile Homepage component again. You might also try selecting another theme component from the dropdown list, then open the list again and select the Force Mobile Homepage component again. Click the “add” button and hopefully that should do it!

3개의 좋아요

You are indeed a hero - now working as advertised! Many thanks for your help today, greatly appreciated!

1개의 좋아요

Yes, I’ve come across this several times. Has this been reported I wonder?

I don’t know - I haven’t - but @tshenry 's suggestion of moving in and out of the drop down menu after a page reload worked.

1개의 좋아요

Nice one! thanks @tshenry :heart:

1개의 좋아요

Any reason not to combine your script with the following in Customize → Themes → Mobile → Header?

<script>
  if (window.location.pathname == "/")
  {   window.location.href = "/latest";
  }
</script>

This will handle the initial redirect to /latest if the user arrives on the homepage.

1개의 좋아요

No particular reason, no. That said, I no longer use that script. With the addition of user-selectable homepages I just have those that prefer /latest select it.

1개의 좋아요

I originally found this topic when searching for a solution to my problem:

As it explains, I have my forum set up to display categories + latest since I don’t only want to display the latest on desktop. Here are the two Discourse settings that make that layout possible:

It’s the ideal layout for me since it both displays the categories for users looking to post something new and makes the latest available for other people who are just coming back to see what’s new.

For anyone reading along who wants to do the same thing, here’s what you need to do:

  1. Go to the Edit CSS/HTML section of your theme:

  2. Add the following script in the Mobile → Header section (so it only affects visitors on mobile devices):

    Here’s the script so you can copy/paste it:

    <script>
        if (window.location.pathname == "/")
        {   window.location.href = "/latest";
        }
    </script>
    
    <script type="text/discourse-plugin" version="0.4">
        api.changeWidgetSetting('home-logo', 'href', '/latest')
    </script>
    

Update: The Forced Mobile Homepage theme component linked above is probably a better way to accomplish this.

10개의 좋아요

이 기능을 사용자별로 설정할 수 있을까요? 각 사용자가 모바일 인터페이스에서 기본 페이지를 직접 선택할 수 있도록 하는 방식입니다. 이미 일반 설정이 존재하므로, 모바일 전용 설정만 추가하면 됩니다.

3개의 좋아요

현재 저도 동일한 문제를 겪고 있습니다: 데스크톱에서는 최신 토픽이 오른쪽에 표시되는 카테고리 뷰를 선호합니다. 하지만 모바일에서는 카테고리 뷰가 카테고리만 표시합니다. 모바일에서는 “마지막” 토픽 변경 사항을 볼 수 있는 뷰를 선호합니다.

다음과 같은 두 가지 설정 옵션이 있으면 좋겠습니다:

  • 데스크톱 기본 홈 페이지: [선택 필드]
  • 모바일 기본 홈 페이지: [선택 필드]

이러한 기능에 대한 PR이 받아들여질 수 있을까요?

7개의 좋아요

이것이 기기별 설정도 될 수 있을까요? 위에 게시된 우회 방법은 모든 모바일 사용자에게 해당 설정을 강제하기 때문에 이상적이지 않습니다(태블릿은 이 측면에서 분류하기가 어렵습니다). 그리고 데스크톱/모바일 구분뿐만 아니라, 기기에 따라 다른 선호도를 설정하는 것이 더 합리적인 경우가 많다는 점은 자명합니다.

1개의 좋아요

이건 바퀴 다음으로 최고의 발명품이야! 형, 고마워

1개의 좋아요

저도 이런 설정이 있으면 좋겠네요… 그렇게 할 수 있는 방법이 있을까요?