Install this theme component
This Discourse theme component adds a toggleable homepage in the header, allowing users to jump between two pages that can be set in the theme component settings.
It uses the primary and tertiary colors from your theme automatically.
You can set the icons (and URLs) for each side of the toggle in the theme component settings.
This was created for an art forum to toggle between an art-focused homepage gallery and a more traditional forum view. The default icons (a gallery and a list) reflect this by default but they are customizable.
Tested on Firefox, Chrome, Safari, and Edge- no issues found. For desktop only- future updates may include a mobile version as well
7 إعجابات
Lilly
(Lillian Louis)
20 مايو 2023، 3:07ص
2
nicely done. i like this.
4 إعجابات
frold
20 مايو 2023، 6:39ص
3
When using that function I get this error
It works when using the url manually
إعجابَين (2)
Seems like a useful component for those that want an art/picture focused home.
However: The gallery view in theme can also be used for a similar purpose.
إعجاب واحد (1)
Jagster
(Jakke Lehtonen)
20 مايو 2023، 6:50ص
6
And FYI for every beginner: icons (list
or grip-vertical
etc.) must be added on admin setting svg icon subset
.
إعجابَين (2)
Jagster
(Jakke Lehtonen)
20 مايو 2023، 6:54ص
7
It looks like to be desktop-only, right?
إعجابَين (2)
Jagster
(Jakke Lehtonen)
20 مايو 2023، 7:40ص
9
I missed that last sentence totally
I think there is a tag for such situations, like desktop
إعجابَين (2)
This appears to be broken… what would it take to repair it?
إعجاب واحد (1)
Lilly
(Lillian Louis)
30 أكتوبر 2024، 3:47م
12
the decorateWidget is deprecated (edit: in the header)
Yup, the widget API’s days are numbered. We are already working to reduce their usage in core.
Right now we are actively working on converting the header. We already took care of the search and user-menu dropdowns, and are now moving on to the rest of the header. Current plan is for this change to be behind a feature flag, so that we can introduce deprecations and start the migration process for the (many!) themes and plugins which are currently using decorateWidget(). @isaac has an early draf…
إعجابَين (2)
david
(David Taylor)
30 أكتوبر 2024، 3:49م
13
Specifically: modifying the header using decorateWidget was deprecated, and is now impossible. More details here:
We’ve recently been working on updating Discourse’s header from the legacy ‘widget’ rendering system to modern Glimmer components. This change is now available in Discourse core behind the glimmer header mode site setting.
Approximate Timeline
(very rough estimates - subject to change in either direction)
Q1 2024:
core implementation finished & enabled on Meta
upgrade advice published; console deprecation messages enabled
…
(decorateWidget itself still exists for now, and is still a supported way to customize some parts of the Discourse UI)
I’ll mark this theme-component broken for now
إعجابَين (2)