رئيسي كبير - رئيسي صغير

سيوفر هذا المكون للقوالب رأسًا ثابتًا يحتوي على شعار كبير عند التمرير في أعلى الصفحة. ومع التمرير لأسفل الصفحة، سيظهر شريط رأس Discourse العادي. يتيح ذلك عرض شعار الموقع الكبير بشكل أنيق في أعلى الصفحة.

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

أفضل طريقة لمعرفة ما يفعله هذا المكون للقوالب هي تجربته، ويمكنك القيام بذلك بزيارة:

إليك محاولة مني لصورة متحركة (GIF) صغيرة توضح كيفية عمله (نوصي بشدة بالنقر فوق الرابط أعلاه للحصول على توضيح أفضل :slight_smile:)

الإعدادات:

هناك حاليًا ثلاثة إعدادات يجب أن تكون واضحة بحد ذاتها:

التثبيت:

مهم: يجب أن تكون تشغل Discourse Version 2.0.0.beta4 أو إصدار أحدث لكي يعمل هذا القالب.

اطّلع على هذا الموضوع للحصول على تعليمات حول كيفية تثبيت مكون القالب:

رابط الاستيراد:

https://github.com/tshenry/discourse-big-header-little-header.git

حول:

جاءت المقترح الأصلي لهذا من @ryanerwin في قناة Marketplace. طلب مني تعميم ما أنشأته له ومشاركته مع بقية المجتمع. لذا فإن هذا القالب مستوحى جدًا ويعود الفضل فيه إليه :slightly_smiling_face:

ملاحظات:

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

المشاكل المعروفة:

بما أن هذا يضيف حشوة إلى div#main-outlet، فقد يتأثر الجدول الزمني للمواضيع اعتمادًا على حجم الشعار الخاص بك. توجد طرق ثابتة للتعامل مع ذلك، لكنها ليست مثالية. من المرجح أن أنشر منشورًا في قناة Dev لتوضيح كل ما جربته ومعرفة ما إذا كان لدى أي شخص أفكار حول كيفية التعويض عن الحشوة الإضافية.

المستودع:

GitHub - tshenry/discourse-big-header-little-header

كما هو معتاد، لا تتردد في النشر إذا كانت هناك أي أسئلة أو مشاكل أو اقتراحات! وقتي ضيق قليلاً حاليًا، لكنني سأحاول معالجة كل شيء بأسرع ما يمكن :slight_smile:

24 إعجابًا

Awesome work on this @tshenry.

For anyone who wants to use a BIG LOGO at the top of their Discourse site, particularly if their logo is not rectangular, this is a great theme plugin!

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

Oh dang, that’s a pretty rad component you’ve got there, thanks for sharing back with us! :heart_eyes:

Any chance of an animated sample, just so those interested in something similar can git the gist of how it feels? (Or better yet, link to a live sample you can share on theme creator so they can play with it themselves!)

6 إعجابات

No problem! :slightly_smiling_face:

I will most definitely add a sample to theme creator. Thanks for the reminder! I need to update my other themes with the links to their demos on there as well. I’ll try to get a GIF in the post as well.

Edit: I’ve added both an animated image and a demo link to the topic post :grin:

9 إعجابات

I believe that recent logo changes may have broken this component - if you look at the theme creator version it is not working

3 إعجابات

Yep, very broken! I’ll get that fixed up ASAP.

5 إعجابات

Ok, it should be fixed now :slightly_smiling_face:

If anyone reading this notices issues after updating the component, please report them!

7 إعجابات

There’s just a slight dead zone under the little header where you can’t interact with certain things. Highlighting text, entering a topic, interacting with the timeline. I’m sorry, I don’t really know how to describe my problem, but you can reproduce it by just having text or the timeline below the little header. Try to highlight the text, or interact with the timeline.

Does anybody have any suggestions to fix this? It’s not a super huge problem in general, but it does make the Table of Contents theme component wonky to work with. I’m not sure if this is something to tell you or them.

I love this component, by the way @tshenry.

3 إعجابات

Thanks for reporting! This should be fixed once you update the component. Let me know if you ever find any other issues.

5 إعجابات

My goodness, that was quick! Works fantastic, thank you so much!

4 إعجابات

I have installed this theme, but my logo is not showing up. It was before I installed this theme.

Is there a solution for this? Thanks!

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

I’ve been meaning to take a look at this component and make sure everything is still working as expected. I’ll take a look either today or tomorrow and let you know.

Edit: I tested it out and all seems to be working correctly. Make sure you add the large logo image to the theme setting. I have a few improvements in mind for this component, but I’m not sure when I’ll get to them.

إعجابَين (2)

@tshenry Why did the background color of my header change from my set color in my theme to white when I activated Big Header - Little Header? Do I need to override it? It feels like the plugin should respect whatever color scheme I have already set in my theme.

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

It looks like I had it set to use the $secondary color variable that’s defined in your site’s color scheme. In hindsight, I should have used $header_background since that would allow a user to swap it out through their color scheme very easily. Changed via:

3 إعجابات

@tshenry Works for me on the “Little” logo (thanks!), but not on the “Big” one, it’s still white.

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

Ah yeah, the “Big” header was always intended to blend into the site’s background. If you want to change that, I would try to work out some CSS to add the background. I can look into adding a toggle when I refactor this component, but I expect that’s going to be a while down the road.

Yes I was able to override it with:

.d-header { background-color: #000 !important; }

Another issue I’m running into is that I have used custom CSS to specify a larger height for my header with a larger logo than the Discourse default.

I feel like it would be useful if we could set a big logo height and a small logo height in your plugin settings so that we can achieve the look that we are aiming for.

Otherwise how would I set the height of the “Little” header?

I’ll try to make things a little more flexible through the settings the next time I work on this, but until then you’ll need to tinker with the CSS and such to find the best solution that fits with your other customizations.

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

Thanks! I had to disable your plugin for now because when in /admin I could not click on the navigation links at the top (Dashboard, Settings, Users, etc…). I can’t tell if it’s an interaction with my CSS but I’ll investigate.

UPDATE: It was indeed my CSS, I made a mistake somewhere, had nothing to do with your plugin.

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