I could create the hamburger and menu with my knowledge of css/html/js. But I was hoping for a way to use the functionality that discourse has already implemented (opening, closing, etc…).
Any suggestions on how to achieve this?
I thought maybe I would be able to extend the widget for the current navigation, change the settings, then attach it to the html I have written for my nav. But the connectors seemed to be predefined, and I wasnt sure how to connect my widget to my html. This might not be the right direction at all either…
This is slightly rough but should get you 99% of the way there when it comes to having an additional menu item with a dropdown panel. Calling this one a pizza menu . Add this to your header.html file.
Ah ok in that case you’re looking at something more like what @simon mentioned in the brand header theme component, I was attaching the action to the existing header widget… the brand header adds it to a new one. The new widget here w/ toggleHamburger:
Thank you for this code. Can you point me in the right direction on filling out the panelContents? I see some indication, but not sure how it all links together.
مرحبًا! أعرف أن هذا موضوع قديم، لكن هذا قريب جدًا مما أبحث عنه/أحاول فعله. لذا، قمت بالنشر هنا (بدلاً من إنشاء موضوع جديد). يرجى مراعاة أنني لست مطورًا ولا أعرف كيفية عمل الإضافات، ولا أستطيع كتابة كود JavaScript. لكنني أعرف كيفية نسخ ولصق الكود؛)
ما أحاول فعله هو إضافة تسجيل الدخول إلى غرفة دردشة داخل قائمة منسدلة. لذا، أريد أيقونة “دردشة”، وفي القائمة المنسدلة ستكون هناك حقل إدخال وزر إرسال، بالإضافة إلى بعض نصوص المساعدة / رابط إلى صفحة المساعدة.
هل يمكنني تكييف الكود الخاص بك، فبدلاً من أيقونة “الأدوات” أضع أيقونة “دردشة”، وكيف أفعل ذلك؟
وثانيًا، كيف يمكنني إدراج كود HTML بدلاً من عبارة “مرحبًا بالعالم”. (بشكل أساسي، كيف أدخل HTML هناك؟)