品牌标题

:discourse2: 摘要 品牌页眉 为移动和桌面视图添加了一个额外的顶部页眉,用于展示您的徽标、导航链接和社交图标。品牌徽标可以是图片或文本。
:eyeglasses: 预览 在 Discourse 主题创建器中预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-brand-header
:open_book: 初次接触 Discourse 主题? Discourse 主题使用入门指南

安装此主题组件

功能

桌面预览:

移动预览:

设置

名称 描述
品牌名称
网站 URL
移动徽标 URL
链接 要在页眉中显示的文本链接
图标 要在页眉中显示的图标链接
自定义 Font Awesome 图标 此主题组件中使用的 FontAwesome 6 图标列表
在移动设备上显示栏
插件出口

使用 Font Awesome 6 图标

为了让 Font Awesome 6 图标在此主题组件中正确显示,您需要在 Discourse 中的以下三个位置添加它们:

  1. svg 图标子集 站点设置
  2. 组件中的 自定义 Font Awesome 图标 设置
  3. 组件中的 图标 设置

此外,对于某些 Font Awesome 6 图标,您需要指定 fafab 前缀加上图标名称(例如:“fab-bluesky”),因为某些图标属于特定的图标子集。有关此用法的详细信息,请参阅 我们将图标升级至 Font Awesome 6!

一旦您在所有三个位置添加了这些图标,您应该能在品牌页眉主题组件中看到它们正确显示。

:discourse2: 由我们托管? 主题组件可在我们的标准版、商业版和企业版计划中使用。

87 个赞
Is there a setting to add Facebook, twitter , Instagram profile links?
Beginner's guide to using Discourse Themes
Reuse Discourse Hamburger Functionality
Introducing Font Awesome 5 and SVG icons
WordPress in a Discourse iFrame?
How to use brand header html in my WordPress site
Can I add a icon and link back to my homesite at the top bar
Login with federated social networks
Customise home login page
How to put a backlink to our company website above the top-menu in discourse?
How to finely scroll out custom header?
How to create additional header?
🌅 Introducing Horizon, our newest theme
Customize Your Site Branding
How to embed Discourse in Wordpress?
Need to create good-looking front page with Discourse login option
How I can add a custom header
Horizon interaction with Brand Header
Customizing your site with existing theme components
Quick access to bookmarks and messages on user menu
How to add a directory of people/businesses to my theme?
Air Theme
How to create custom theme component?
Custom website header with forum
How do the Links and Icons settings work?
Adding header in theme messes up topic progress bar (when docked)
Structuring a multilingual community
Brand Header breaks chat reply box on mobile (iOS)
Help needed with theming and logo
Insert Link to External Website
Are these possible only with a custom theme?
Horizon Theme
Dropdown links in existing Header
How do I move an image/banner to the VERY top of the page?
Combining Brand Header and Header Submenus Plugins
How to add top menu bar like try.discourse.org
Brand header theme component breaks page layout on static and no_ember pages
Brand header theme component breaks page layout on static and no_ember pages
TypeError: Discourse._registerPluginCode is not a function
DiscoTOC & Brand Header - using together
Structuring a multilingual community
Display name of forum
How to make your side have a side-bar and external links
TavoWEB theme for Discourse
Why does the logo navigate to Discourse home not main site home
Customize the header with links, icons, or menus

@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.

Screenshot%20at%20Oct%2026%2010-13-03

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?

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.

Hey there, would you be open to adding an option to display the bar below the header instead of above?

1 个赞

Sure, I will accept it if you can submit it in a PR.

4 个赞

Any hints as to what needs to be changed for that? I never worked with Discourse before.

1 个赞

https://github.com/discourse/discourse-brand-header/blob/master/common/header.html#L192-L194

You should mount the widget in “below-site-header” connector instead of “above-site-header”. It will require few more tweaks too.

6 个赞

Thanks, I got it to work! Will probably PR when I have a bit more time.

4 个赞

I merged your other PR which will add an optional target parameter to links.

https://github.com/discourse/discourse-brand-header/pull/4

8 个赞

This is now done in the commit below

4 个赞

I love this change, but on several sites where I use it personally, and on a hosted site I’m a moderator of (the NaNoWriMo forums) we’ve been seeing some issues. Unlike the regular hamburger menu, if you try to swipe it away it bounces back onto the screen.

I’ve personally seen this on a fully updated Moto (g7) Power on Android 9 and on a fully updated iPhone 8.

There has also been at least one report of the menu opening on touches near the icon and not just on it, but I’ve personally been unable to reproduce that particular behavior.

2 个赞

Thanks! Turns out I did not have time to make a proper PR, do you think you’ll be able to add the below/above site header setting?

1 个赞

Seems like it would be very useful to be able to add attributes to the header links somehow, e.g. for css class, target, etc.

1 个赞

I have had a query as to why the menu is not working on mobile devices. The user pressed on the left burger menu but then on a menu link - and his perception was it wasn’t working as the menu still filled most of the screen.

I’ve had to explain you need to touch somewhere on the right of the screen, to the side of the menu, to close it.

Would it be possible to make it more intuitive, either by:

  • Auto-closing the menu when you click on a menu link on mobile devices?
  • Including a ‘Close Menu’ button on mobile devices?
1 个赞

I’ve been meaning to make a similar request. I often try to dismiss the menu on mobile by swiping it to the left. It appears to be working, but then it pops back into place. The other menus in Discourse it works to swipe them back to the side to dismiss them.

1 个赞

你好!

我们在同一论坛的两个版本(discourse 3.2.0.beta4-dev 和 discourse 3.3.0.beta1-dev)之间尝试了不同的布局。

下面是一个没有自定义 CSS 的示例,只有原始组件。

discourse 的 HTML 布局在两个版本之间是否发生了变化?

另外,“滑入”行为在 v3.3 中已损坏。

2 个赞

我在 Discourse 3.2.2 上遇到了同样的问题。幻灯片效果已损坏。

我想知道,根据以上帖子的日期,brand-header 主题组件是否仍然受支持?

根据之前的两篇帖子,这个问题已经存在至少 5 个月了,而且没有人回应。我将假设这个主题组件已经停止维护,除非有人另有说明。