功能
桌面预览:
移动预览:
设置
名称
描述
品牌名称
网站 URL
移动徽标 URL
链接
要在页眉中显示的文本链接
图标
要在页眉中显示的图标链接
自定义 Font Awesome 图标
此主题组件中使用的 FontAwesome 6 图标列表
在移动设备上显示栏
插件出口
使用 Font Awesome 6 图标
为了让 Font Awesome 6 图标在此主题组件中正确显示,您需要在 Discourse 中的以下三个位置添加它们:
svg 图标子集 站点设置
组件中的 自定义 Font Awesome 图标 设置
组件中的 图标 设置
此外,对于某些 Font Awesome 6 图标,您需要指定 fa 或 fab 前缀加上图标名称(例如:“fab-bluesky”),因为某些图标属于特定的图标子集。有关此用法的详细信息,请参阅 我们将图标升级至 Font Awesome 6! 。
一旦您在所有三个位置添加了这些图标,您应该能在品牌页眉主题组件中看到它们正确显示。
由我们托管? 主题组件可在我们的标准版、商业版和企业版计划中使用。
87 个赞
angus
(Angus McLeod)
2018 年10 月 25 日 23:16
89
@vinothkannans Great component!
One small issue. Currently, if a header link is internal to a site (e.g. to a particular category), if it is tapped in the responsive menu, the responsive menu will stay open. The expected behaviour is that the menu would close.
5 个赞
I am also seeing this issue for internal links, where the header does not disappear on mobile. Instead, the header slides right and leaves the main page opaque (I believe an overlay is being set), even if the header is folded back up.
Is there a fix for this?
hosna
(hosna)
2019 年4 月 10 日 15:00
124
In the mobile view, when we click on the hamburger menu, if then we click outside of the menu, the hamburger menu would be expanded even more, instead of closing. and also it has some other glitches. for example when hamburger menu is open and we click on a topic link.
1 个赞
I’m curious, is there some sort of code I can use/edit to move the links to this side of the header?
Ideally with the fa-icons left in place (on the far right). I’d just like to see what it looks like.
你好,你是否愿意添加一个选项,将工具栏显示在标题下方而不是上方?
1 个赞
有什么关于需要修改什么的提示吗?我以前从未接触过 Discourse。
1 个赞
谢谢,我搞定了!等我有更多时间后大概会提交 PR。
4 个赞
我已合并你的另一个 PR,该 PR 将为链接添加一个可选的 target 参数。
master ← Stanzilla:target
merged 07:09PM - 29 Jan 20 UTC
Not sure if this is the best implementation but it works fine. I added the addit… ional trim()s because with your current core you ended up with spaces in the url if people did `Name, url`
I added `omitSpan` because otherwise `target` won't work since the click will be on the `span` and not the `a`.
8 个赞
我非常喜欢这个改动,但在我个人使用的几个网站以及我担任版主的主机网站(NaNoWriMo 论坛)上,我们遇到了一些问题。与常规汉堡菜单不同,如果你尝试滑动关闭它,它会弹回屏幕。
我本人在完全更新的 Moto (g7) Power(运行 Android 9)和完全更新的 iPhone 8 上都遇到过这个问题。
此外,至少有一起报告称,菜单不仅在点击图标时打开,在图标附近的触摸也会触发打开,但我个人无法复现这一特定行为。
2 个赞
谢谢!看来我确实没时间提交一个正式的 PR,你觉得你能添加下面/上面的站点标题设置吗?
1 个赞
看起来能够以某种方式为标题链接添加属性(例如 CSS 类、target 等)会非常有用。
1 个赞
Rhidian
(Rhidian Bramley)
2021 年4 月 6 日 10:56
213
有人询问为何菜单在移动设备上无法正常工作。用户点击了左侧的汉堡菜单,然后点击了菜单链接,但由于菜单仍占据屏幕大部分区域,他误以为菜单没有响应。
我不得不解释说,用户需要触摸菜单右侧的屏幕区域才能关闭菜单。
是否有可能让操作更加直观,例如:
在移动设备上点击菜单链接时自动关闭菜单?
在移动设备上添加一个“关闭菜单”按钮?
1 个赞
我一直想提出类似的请求。在移动设备上,我常尝试通过向左滑动来关闭菜单。看起来操作成功了,但菜单随后又弹回原位。而在 Discourse 的其他菜单中,向侧边滑动确实可以成功关闭它们。
1 个赞
weber-s
(Samuël Weber/GwendalD)
2024 年2 月 26 日 11:49
251
你好!
我们在同一论坛的两个版本(discourse 3.2.0.beta4-dev 和 discourse 3.3.0.beta1-dev)之间尝试了不同的布局。
下面是一个没有自定义 CSS 的示例,只有原始组件。
discourse 的 HTML 布局在两个版本之间是否发生了变化?
另外,“滑入”行为在 v3.3 中已损坏。
2 个赞
37Rb
(Ryan)
2024 年6 月 25 日 23:08
263
我在 Discourse 3.2.2 上遇到了同样的问题。幻灯片效果已损坏。
We’re having a problem where the brand header menu on the upper left only partially expands on mobile when tapped. We have it set to not display the bar on mobile. If I just tap the hamburger menu it looks like this.
[Screenshot 2024-06-17 at 11.30.45 AM]
But if I then resize the window in any direction it expands fully and shows all the sub-links.
[Screenshot 2024-06-17 at 11.30.55 AM]
How do I get it to expand fully when tapped without needed a window resize?
我想知道,根据以上帖子的日期,brand-header 主题组件是否仍然受支持?
37Rb
(Ryan)
2024 年7 月 8 日 15:25
264
根据之前的两篇帖子,这个问题已经存在至少 5 个月了,而且没有人回应。我将假设这个主题组件已经停止维护,除非有人另有说明。