自定义汉堡菜单链接

:discourse2: 摘要 自定义汉堡菜单链接 将允许您轻松地向汉堡菜单添加链接。
:eyeglasses: 预览 在 theme-creator.discourse.org 上预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-custom-hamburger-links
:open_book: 刚接触 Discourse 主题? Discourse 主题使用入门指南

安装此主题组件

示例

桌面端

移动端


设置

您可以通过逗号分隔的值按以下顺序添加链接:

文本,URL,位置,目标

文本
是显示在菜单中的链接名称。

URL
是您希望链接指向的路径。您可以使用相对路径,例如:

/tags/funny

/t/231

(如果您更喜欢的话)。

位置
可以是以下两个值之一:字母 g 或字母 f

如果您希望链接出现在 generalLinks 部分,请使用 “g”:

如果您希望链接出现在 footerLinks 部分,请使用 “f”:

目标(可选)
如果您需要链接在新标签页中打开,请使用 “blank”。

59 个赞
How can I create a new link in the drop down menu?
How to customise the dropdown menu
Login Required activated - after successfull login it transfers you to nonexisting page
Globally pinned/banner topics management
Add a new item to the "About" page
How to customise the dropdown menu
Edit the hamburger menu to have new hyperlink to a page
Better navigation for (structured) tags
2021: The Year in Review
Why is Guidelines called FAQ? Can we link to GUIDELINES and FAQ from hamburger menu?
Try out the new sidebar and notification menus!
Try out the new sidebar and notification menus!
Privacy Policy does't meet Google's requirements
Can I enable the sidebar?
How can I add the Terms of Service and Privacy to the hamburguer menu?
Customizing FAQs and Guidelines
2023: The Year in Review
My Wiki of useful Meta (and other) links
Add the ability to move a link to the hamburger menu on mobile
How to let the customer change their credit card info
How to add a Leaderboard link to the hamburger menu?
How to re-position an option from Hamburger menu
Custom pages for About and Guidelines - how to replace the default?
How can I add custom hamburger menu
Rearrange Existing Hamburger Menu Items
Heading for group of categories
User-defined theme switcher disappears on admin pages
Can I add/change the links at the bottom of the menu?
Locations Plugin :earth_africa:
Add a global header between Discourse & Website
Deep link to profile edit page
Add Custom elements to Experimental Sidebar
Locations Plugin :earth_africa:
Air Theme

Thats a nice addition, thanks for that. It’s already installed :smiley:

Could you add a target option so that it is possible to open the link in a new tab/window (if no target is given just use “_self”)

Text,URL,Location,Target

10 个赞

请添加一个选项,将链接放在下拉面板的最顶部 :slight_smile:

5 个赞

我可能也会在某个阶段亲自尝试一下(不过得先学一点基础),但先把我的想法记录下来:

功能请求:

第 1 项:支持悬停文本。目前核心汉堡菜单链接已使用此功能,这将非常有帮助。

第 2 项:与 Rob 的分支合并,这显然是一个好主意:

第 3 项:支持 target=“_blank”,正如 Richie 所提(这显然也是个绝妙的主意):

第 4 项:提供更多对链接顺序的控制(这可能非常棘手!)

7 个赞

有没有办法根据用户界面语言来翻译自定义汉堡菜单的链接?

例如,我可以将 YAML 翻译文件封装到一个自定义插件中,但我不确定可以使用哪些翻译键。

难道没有实用的方法来实现这一点吗?

2 个赞

有没有办法自定义链接的顺序,以便将它们按特定顺序排列?

6 个赞

那么我们有没有可能在新标签页中打开呢?

1 个赞

我觉得没人再处理这个了 @savas :confused:

2 个赞

看起来我在将此项添加到页脚链接时遇到了问题,即使我在“位置”中添加了 f。有人遇到同样的问题吗?

1 个赞

今晚看到这个我超级激动!!

我超级超级希望有一个新功能,能让链接以 target="_blank" 的方式在新窗口打开 :scream:

我立刻上 GitHub 看看有什么新内容!

@tshenry,我太失望了 :pensive:

:rofl:

3 个赞

也许这个能帮到你?:wink:

这似乎是最常被请求的功能,而且添加支持并不算太难。目前就先这样吧 :slight_smile:

18 个赞

我现在的人生圆满了 :heart_eyes:

感谢 @tshenry,这真是个天大的好消息 :clap:t2: :bowing_man:t2:

4 个赞

嘿,快速问个问题,如何本地化自定义汉堡菜单的文本?我想完全本地化我的论坛,但似乎找不到相关文本。

2 个赞

这是一个很有用的组件。但我们能否在其中添加 Font Awesome 图标呢?如果能展示社交媒体个人资料的图标,人们就能轻松关注我们的社交媒体账号,那就太好了。

2 个赞

太棒了,非常感谢!:wink:
能否快速告诉我——如何本地化自定义汉堡菜单的文本?

3 个赞

我已添加了对图标的支持,您可以尝试使用此组件的分支:https://github.com/nolosb/discourse-custom-hamburger-links-with-icons.git

使用时的两点说明:

  • 图标应为列表中的第一项:
    Screenshot from 2021-07-01 11-10-15
    如果您希望链接不带图标,只需不添加图标即可,但请保留末尾的逗号 ,
    Screenshot from 2021-07-01 11-10-40

  • 如果图标未默认包含,请记得将其添加到图标列表中:
    Screenshot from 2021-07-01 11-11-06

7 个赞

你能将这些更改推送到官方的 Theme 组件吗?安装官方的 Theme 组件总是更好的,因为它会随着 Discourse 的未来更新而得到维护。

8 个赞

合并到官方插件会更好。我想在汉堡菜单中添加社交媒体按钮。但没有图标,效果不会那么好。

另外,CSV 字段不允许有空格这一点有点不清楚。
这样可以:Footer Link,https://google.com,f
但如果带空格,由于缺少空格,该项目会插入到常规字段而不是页脚中:Footer Link, https://google.com, f

2 个赞

您好!

有了新的侧边栏,能够为我们的链接添加自定义图标将是一个很棒的补充。

我可以在接下来的几天里尝试着手处理这个问题并提交一个 PR……

9 个赞

快速提问……

我在新的 Discourse 实例上安装了主题组件,但由于某个未知原因,默认链接未显示在侧边栏的“更多”部分:

我没有修改代码,这是一个全新的主题组件安装。

但是,两年前安装的主题组件在我的另一个论坛上可以正常工作:

没有显示任何错误。有什么想法可以解释为什么主题组件在新安装上不起作用吗?:thinking:

4 个赞