自定义标题链接(图标)

Oh my - that did the trick, thank you so much!
I tried “building” just in the theme component (didn’t work) and “fas-building” in both places (didn’t work) but it didn’t cross my mind to try the plain version in both fields.

I still would suggest to make this differene between fa(s) and fab/far more clear in the component description.

2 个赞

Hello.
Thanks for the great plugin.

I would be grateful if you could provide one support.

I have a Login Required setting on my Discourse.
When I visit a site with this setting, I am naturally asked to create an account or log in, and the header shows an icon that I created with this plugin.

image
Need account or login page(in Japanese)

If that’s all there is to it, there’s no problem, but if you click on them, you will be able to open the linked page without logging in.
(The link is to a plugin that I created myself, and the Path is a path directly under the site root, such as /test_path. Even with this path, if you specify the URL directly, etc., you will be asked to create an account or log in. Only if you go through the header icon of this plugin, the page will be displayed without login).

The best solution is to not show the icon in the first place, but at the very least, you need to be able to click on the icon to see the page that asks you to log in.

I would really appreciate it if you could help me with a solution. Thank you very much.

1 个赞

Hey @Johani. It looks like this needs to be updated for the new way theme variables work. I see this error in the admin panel:

Error: Undefined variable: "$add-whitespace". on line 14 of common.scss >> @if $add_whitespace == "true" { ----^
3 个赞

Hello,

I’m linking to a limited access page, where I need to pass in some variables to the url. Would it be possible to get some system variables like username, userid, mail etc?

1 个赞

I am looking for the same thing. I want to post the logged-in user’s username to a remote server when the header icon is clicked. I understand that I can get the username via javascript, but I am not sure how I can do so this via a header icon:

<script type="text/discourse-plugin" version="0.8">
const username = api.getCurrentUser().username;
</script>

Thanks!

1 个赞

温馨提示,我注意到“主题设置”说明中存在一个错误。

顶部显示顺序是 title, icon, URL, view, target

但底部显示顺序是 title, icon, view, URL, target

顶部是正确的,URL 在 view 之前。

请看下面的截图:

3 个赞

我刚刚为此做了一个PR:

5 个赞

谢谢!我想总有一天我会学会如何做,并有勇气去做一个 PR :smiley:

3 个赞

有办法指示图标的位置吗?我正在使用一个自定义图标,但聊天和另一个主题组件图标在同一个标题中,我想将自定义标题图标设置在搜索图标旁边。

大家好!

感谢这个很棒的主题组件!不过我遇到了一点问题:有些图标工作正常,例如 fa-rocket,但有些图标却不显示,例如 fa-rocketchat,尽管我认为我已经安装了所有必需的图标类。知道是什么原因造成的吗?非常感谢 :slight_smile:

另外:如何获取常规的 Font Awesome 图标而不是实心图标?我尝试包含 far-iconnamefa-regular,但这似乎不起作用……

可能是因为这个

关于你问题的第一个部分。我可能错了,但试试在你的站点设置的 svg icon subset 中添加 rocket chat 图标。

1 个赞

抱歉,这并不能为我解决问题。

页眉链接是:

Rocket.Chat,rocket,https://chat.domain.de,vdo,blank

在“主题组件设置”下的SVG 图标以及“Discourse 主设置”下的SVG 图标子集中,我已按照Font Awesome 图标说明中的详细说明添加了 fa-rocketchatfa-brands。它自 FA 5.0.0 版本起就已支持,所以不可能是这个问题……

有人有什么想法,或许能帮帮我吗? :slight_smile:

您需要:

  1. fab-rocketchat 添加到 svg icon subset
  2. Header links 更改为 Rocket.Chat,fab-rocketchat,https://chat.domain.de,vdo,blank

这些说明具有误导性,但回顾一下,可能并不算不准确:

困难之处在于,您必须将 Font Awesome 网站上的 fab fa-rocketchat 转换为 Discourse 上的 fab-rocketchat

2 个赞

有什么方法可以添加我上传到网站的 SVG 图标?(不使用 Font Awesome 网站上的图标)

我绞尽脑汁想解决一个我不知道如何解决的问题!

我使用“headset”图标,并且可以正常使用它

rocket | Font Awesome

但是当我想要使用“light headser”图标时,我根本无法使用它

rocket | Font Awesome

我已经尝试过使用“fab-”、“fas-”或“far-”,也尝试过不加前缀,我已经把名字写在SVG部分了,我尝试了一切,但就是无法使用它

[image]
同样,对于Google Play商店图标,我也无法使用,根本不行

rocket | Font Awesome

为什么会这样?

可能是浅色版本是“pro”图标:

要使用“headset”的浅色样式,您需要订阅 Pro 级别计划或包含该图标(或样式)发布的特定版本 Font Awesome 的永久 Pro 许可证。

1 个赞

我也想知道。我想添加一个 Letterboxd 图标(在网上已经有人制作并提交给 Font Awesome,但未被接受)。

您可以通过主题添加自己的 SVG 图标:

2 个赞

如何在网站底部(移动模式下)放置图标,使其对所有人显示相同?

例如:时间线按钮在所有不同型号的手机和移动系统上都显示在相同的位置。

现在,当我使用 CSS 将标题按钮菜单放在底部时,在某些手机上它们显示在正确的位置,在另一些手机上位置会稍微向上,在另一些手机上会稍微偏向一侧,为什么会这样?

还有一个疑问,有没有办法放置一个图标,当我点击这个图标时,它会像下面的例子一样打开其他带有其他图标的选项?