可选的移动标题头

:discourse2: 摘要 可选的移动端标题头 使标题在移动端切换为标题的功能对站点和管理员以及用户而言都是可选的。
:eyeglasses: 预览 在 Discourse 主题创建器上预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-optional-title-mobile-header
:open_book: 初次使用 Discourse 主题? Discourse 主题使用入门指南

安装此主题组件

功能

当在用户偏好设置中禁用时 → 界面:

用户将无条件看到标准标题头:

当启用时,"向下滚动时切换为标题"的行为保持不变:

作为管理员,你可以在主题组件部分控制默认是开启还是关闭:

当前注意事项

  1. 用户设置仅保存在本地存储中,且仅针对当前设备

  2. 更改设置后,用户必须重新加载站点。

  3. 尚未进行适当的本地化,也不支持本地化。

设置

名称 描述
默认启用 在移动端启用将标题头切换为主题标题
翻译 默认值
mobile_switch_title 向下滚动时将标题头切换为主题标题

:discourse2: 由我们托管? 主题组件在我们的 Standard(标准)、Business(商业)和 Enterprise(企业)计划中均可用。

28 个赞

Do hosted discourse instances have the option to install this component? I sent this to the admin of the site I use, but he’s having trouble getting the setting to show up for users.

There is no restriction on the use of this theme component (or any theme component) on hosted sites. I can take a look shortly.

2 个赞

To follow-up on @seanblue. The theme component installs without issue. I can see the component on the Theme list in Admin. We aren’t seeing the User > Preference > Interface option as seen in the quote.

2 个赞

Have you added the theme component to the active theme(s)? Theme components do nothing themselves unless they’re part of a theme.

8 个赞

Nope. I did not. Adding them to the active themes did it! Thanks for the assistance and education.

5 个赞

Hmm, this doesn’t seem to be working, anymore.

I installed it fine, I see the component, I added it successfully to all themes >> Nada.

@david can you test this out?

2 个赞

@dylanh724 what issue are you seeing here? This theme does nothing on Desktop, so you’ll only see the new option on mobile.

Previously it was necessary to manually refresh the site for the setting to take effect, but I just fixed that.

6 个赞

Users cannot select this in options because the field does not exist.
image

Are they looking for the setting on mobile, or on desktop? Are you able to share a link to the community?

1 个赞

There’s also supposed to be an admin option, right?

https://forum.imperium42.com

Are they looking for the setting on mobile, or on desktop? Are you able to share a link to the community?

Tried both

I just signed up quickly, and I can see the setting in the user preferences on mobile:

Yep, that is located in the themes area. Find the page for the component, and then find the “theme settings” section at the bottom of the page. There’s a screenshot of it in the OP:

4 个赞

I can’t see it all – I wonder if this only works for new accounts? There’s a friend helping me test and he can’t see the option, either. I’m testing desktop, he’s testing mobile.

I did, however, find the theme option within the component (thanks):
image

1 个赞

It definitely will not appear on Desktop. Is it possible that your friend has switched to Desktop view on his mobile?

3 个赞

You keep saying this as if the option doesn’t show on desktop – or is this intended that you can only selection this OPTION when on mobile (rather than the event happening only on mobile, which I understand)?

Correct, you can only toggle the setting when using the mobile device. The theme component does absolutely nothing on Desktop.

6 个赞

@pmusaraj I think some of your recent changes broke this.

@tgxworld when you are done if you need a theme to test the new user selectable stuff this is a great one!

8 个赞

Fixed, this now works with latest core.

8 个赞