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)

هل هناك سبب يمنع دمج سكريبتك مع الكود التالي في تخصيص ← السمات ← الجوال ← الرأس؟

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

سيتم من خلال هذا الكود توجيه المستخدم تلقائيًا إلى /latest عند وصوله إلى الصفحة الرئيسية لأول مرة.

إعجاب واحد (1)

لا يوجد سبب محدد، لا. ومع ذلك، لم أعد أستخدم ذلك السكربت. مع إضافة صفحات رئيسية قابلة للاختيار من قبل المستخدم، أوجه أولئك الذين يفضلون /latest لاختيارها.

إعجاب واحد (1)

لقد وجدت هذا الموضوع في الأصل أثناء البحث عن حل لمشكلتي:

كما يوضح، قمت بإعداد منتداي لعرض الفئات + آخر المواضيع، لأنني لا أريد عرض آخر المواضيع فقط على سطح المكتب. إليك إعدادات Discourse اللتان تجعل هذا التخطيط ممكنًا:

هذا هو التخطيط المثالي بالنسبة لي، حيث يعرض الفئات للمستخدمين الراغبين في نشر شيء جديد، ويجعل آخر المواضيع متاحًا للآخرين الذين يعودون فقط لمعرفة الجديد.

ولأي شخص يقرأ هذا ويريد فعل الشيء نفسه، إليك ما يجب عليك فعله:

  1. انتقل إلى قسم تحرير CSS/HTML في نسختك:

  2. أضف السكربت التالي في قسم الهاتف المحمولالترويسة (حتى يؤثر فقط على الزوار على أجهزة الهاتف المحمول):

    إليك السكربت حتى تتمكن من نسخه/لصقه:

    <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>
    

تحديث: يُعد مكون النسخة الصفحة الرئيسية الإجبارية للهاتف المحمول المذكور أعلاه طريقة أفضل على الأرجح لتحقيق ذلك.

10 إعجابات

هل من الممكن توفير هذه الميزة على أساس كل مستخدم؟ مثلاً أن يتمكن كل مستخدم من اختيار صفحته الافتراضية على الهاتف المحمول في تفضيلات الواجهة (هناك بالفعل إعداد عام موجود، ونحن بحاجة فقط إلى إعداد خاص بالهاتف المحمول فقط).

3 إعجابات

أواجه نفس المشكلة حاليًا: على سطح المكتب، أفضل عرض التصنيفات الذي يظهر أحدث موضوع على الجانب الأيمن. أما على الجوال، فيعرض عرض التصنيفات التصنيفات فقط. وعلى الجوال، أفضل عرض تغييرات “آخر” موضوع.

سيكون رائعًا وجود تفضيلان:

  • الصفحة الرئيسية الافتراضية على سطح المكتب: [حقل اختيار]
  • الصفحة الرئيسية الافتراضية على الجوال: [حقل اختيار]

هل هذا شيء يُقبل من خلاله طلب دمج (PR)؟

7 إعجابات

هل يمكن أن يكون هذا إعدادًا على مستوى الجهاز أيضًا؟ فالحلول البديلة المذكورة أعلاه ليست مثالية لأنها تفرض الإعداد على جميع مستخدمي الأجهزة المحمولة (ويصعب تصنيف الأجهزة اللوحية في هذا الصدد). ومن الواضح تمامًا أنه في كثير من الأحيان قد يكون من المنطقي وجود تفضيلات مختلفة بناءً على الجهاز، وليس مجرد التمييز بين سطح المكتب والأجهزة المحمولة.

إعجاب واحد (1)

هذا أفضل شيء بعد العجلة! شكرا يا أخي

إعجاب واحد (1)

أود أن أحصل على هذه التفضيلات أيضًا… هل هناك طريقة للقيام بذلك؟