多功能横幅

:discourse2: 摘要 Versatile Banner 为您的网站添加可自定义的横幅。
:eyeglasses: 预览 在 Discourse 主题创建器中预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-versatile-banner
:open_book: Discourse 主题新手? 使用 Discourse 主题的入门指南

安装此主题组件

功能特性

此主题组件是先前横幅功能的演进。其目标是通过使用主题设置,提供更便捷和灵活的使用体验。

以下是功能亮点:

  • 限制仅对登录用户或匿名用户显示
  • 限制仅在移动端或桌面端显示
  • 限制仅在特定页面显示
  • 可关闭、可展开及始终可见的选项
  • 全浏览器宽度选项
  • 颜色管理
  • 使用 HTML 自定义标题和列(详见下文)
  • 持久状态选项(详见下文)

自定义横幅内容

横幅内容分为主要标题和列。您的横幅最多可包含 5 列,但由于宽度限制,建议列数为 3 列或更少。我们提供了 HTML 模板,您可以根据个人需求进行自定义。您还可以控制每列的宽度,并在每列顶部添加任意图片或 Font Awesome 图标。

使用持久状态选项

持久状态选项将依赖最多两个 Cookie。这些 Cookie 将包含横幅的名称以及一个与横幅状态相关的 true/false 值。如果您担心在网站上使用 Cookie,最好避免使用此设置。为 cookie_lifespan 设置选择相对时间选项,可确保横幅在用户点击相应按钮后,保持关闭/展开/折叠状态持续该段时间。如果没有此设置,横幅将在每次完整页面加载时重置。如果您对横幅进行了更改并希望确保所有用户(包括之前关闭过横幅的用户)都能看到这些更改,请务必更改“Cookie 名称”。这将实质上重置任何持久状态,然后允许用户再次关闭横幅。

设置

名称 描述
show for members 为登录论坛的用户显示横幅
show for anon 为匿名用户显示横幅
display on mobile 在移动设备上显示横幅
display on desktop 在桌面计算机上显示横幅
display on homepage 在首页显示横幅
url must contain 输入应显示横幅的路径。在路径末尾添加 * 作为通配符
dismissible 允许用户关闭横幅
collapsible 允许用户展开和折叠横幅
default collapsed state 启用 collapsible 设置时的默认折叠状态
cookie lifespan 用于记住横幅是否已关闭、展开或折叠的 Cookie 的有效期。如果设置为"none",此组件将不使用任何 Cookie,并且任何与此横幅相关的已创建 Cookie 将在用户下次执行完整页面加载时删除。数值以单个单位衡量,因此设置"year"表示一年,"week"表示一周,以此类推。
cookie name 当对横幅进行重要更改时,您必须更改 Cookie 名称,以确保所有用户都能看到这些更改。
full width banner 以全浏览器宽度显示横幅
swap default positioning 如果还有其他横幅相关组件处于活动状态,请使用此选项将其位置与 Versatile Banner 互换
plugin outlet below-site-header 将其置于侧边栏上方,above-main-container 将其置于侧边栏旁边的内容上方
banner background image 背景图片的源 URL。提示:您可以将图片上传到主主题并使用该 URL,但请确保不要使用此组件的"Uploads"部分。添加到此组件的任何上传内容在更新时都会被删除。
banner background image dark 检测到系统深色模式时背景图片的源 URL。
background color 用作背景图片的替代
background color dark 检测到系统深色模式时用作背景图片的替代
primary text color 横幅的主要文本颜色
primary text color dark 检测到系统深色模式时横幅的主要文本颜色
secondary text color 图标和文本标题的文本颜色,以及按钮背景颜色。
secondary text color dark 检测到系统深色模式时图标和文本标题的文本颜色,以及按钮背景颜色。
link text color 横幅内链接的文本颜色
link text color dark 检测到系统深色模式时横幅内链接的文本颜色
翻译 默认值
close.title 关闭横幅
close.label 关闭
toggle.title 展开/折叠横幅
toggle.collapse_label 折叠
toggle.expand_label 展开

:discourse2: 由我们托管?主题组件可在我们的 Pro、Business 和 Enterprise 计划中使用。

101 个赞
Homepage Banner
Homepage specific design and content
Showing two banners: one to anonymous users, and one for logged-in members
Discourse Theme Creation
Activated child Component and broke Discourse!
How to add a simple Banner
Landing page customization
Adding a new banner just above the logo
Banner on Discourse
Ideas for highlighting content on our forum
Impact of component positioning with 2.5.0.beta6
Using an Image for a Global Banner Topic - Dimensions?
Showing a Warning to Non-Registered Users
Homepage Feature
Customise home login page
Enhancing My engineering Community Landing Page - Technology Support Category
How to add top welcome message to the board
How is the Banner at meta.discourse.org created?
Is it possible to change the order of topics?
Can the new About page be more visible?
Need help to emulate old forum
Creating a banner that only 1 group can see, while the other groups don't
Sticky global notice
Banner text customization for Subscriptions plugin
How to I stop topics automatically un-pinning when a user reaches the bottom?
How to insert Versatile Banner before the content of the post.?
Need guidance for adding description bar
Customizing your site with existing theme components
How to Set a Closable Banner at the Top of site?
Order of two items in the same plugin outlet
How to add this type of banner?
Customize Your Site Branding
Can the new About page be more visible?
Asking for advice on "How to create a Banner on the main page"/
No HTML in global notice
Welcome Link Banner theme-component with photos
How to apply CSS code only in the discourse home page?
How to add a header image and customize it
Make the Welcome Banner less intrusive
Your own banner with a link
I want add photo for download my app
How to add title and buttons naturally above forum topics?
Where shall I put this code for a top banner?
Is it possible to insert a box of text between the header and topic list?
How do I create a welcome banner like the one on this site?
Customizing the groups page
What are good plugins or theme components for a forum emphasizing pictures?
Creating a banner to display at the top of your site
Horizon Theme
Missing margin in the .banner- box for Versatile Banner TC
What Are Some Good Welcome Banner Designs?
App interviewer
How minimal is your forum?
How to make the automatic dark theme the same as the selected dark theme?
Hover preview and quote of the day
Creating a "Featured Categories" homepage banner
Making my discourse site look a certain way
Help with alignment in the "versatile banner" plugin
Make Banner Undismissable
Can I add a banner only on my homepage?
Welcome message at the top
Globally pinned topic only appears in one category
Pin a post even in the categories home page
How do i turn of unpin/pin option for my forum users?
[PAID] Assistance to Set-up My Forum
Custom HTML on Groups page
Banner diference mobile/web
Help me code menu top same image
Publish a notification at top of the page
How to create a welcome banner/section?
Landing page customization
Message to display to only users without accounts/logged in?
Turned my Discourse into a successful ecommerce platform!
Category Banners
Adding a new banner just above the logo