我如何添加自定义汉堡菜单

您好。

我想创建一个类似 Discourse 汉堡菜单的新菜单,并在其中添加一些链接。最好的方法是什么?

谢谢。

Partial solution?:

3 个赞

Yes, I have seen these options. But i need more customization. I want to add another icon beside the hamburger menu and i want to add my menu items in it.

What is the best way to do this? I want to learn this. I need some JS customizations or i must check theme files? I setup my local development environment for that. I will do the experiments on it.

But thank you so much for your ideas anyway :slight_smile:

I added another hamburger menu to Discourse on my local development environment with Google Chrome console.

<li class="header-dropdown-toggle"><a href="" data-auto-route="true" title="go to another topic list or category" aria-label="go to another topic list or category" id="toggle-hamburger-menu" class="icon btn-flat"><i class="fa fa-bars d-icon d-icon-bars" aria-hidden="true"></i></a></li>

How do I apply this code to the Discourse’s theme template? Any idea?

Take a look at this Topic:

4 个赞

Thanks @merefield I’ll look into it.

1 个赞

这个 SitePoint 链接已失效。有没有更新的链接,或者关于自定义汉堡菜单的建议?

链接在我这里可以正常打开。而且,无论如何,你最好在那个链接所在的帖子下发布,这样如果出现问题,楼主可以处理。

2 个赞