Tag Components - Suggestions and Discussion


Want a custom design for your topic/adventure? Bring it up here!

Whenever you create a new topic, you have the ability to add one or more tags to help describe your topic. These tags can help with search and theming, but they can also allow discourse to load a custom component or theme, into your topic.
What are components?
A component is an additional .css, or javascript feature that affects the normal presentation or behavior of a discourse page. Components can be applied site-wide, or they can be limited to individual topics. Because multiple components can be applied at once, they tend to either be small in scope or not overly complicated (although that does not have to be the case)
What are some examples of components?
With topic specific components you could:

  • Give your entire entire topic a green background.

  • Give a border or logo to all of your specific posts.

  • Give a specific word or phrase unique styling across all posts in your thread.

  • Make your topic address the current user by name.

  • Display data about user interaction.

  • Have an AI summarize your adventure.

  • Run a small javascript game across multiple posts.

There is an entire repository of existing components that you can find here: theme-component - Discourse Meta

It ranges from changing the size and shape of avatars, to supporting custom graphing designs

And they are all open source!

Now hold up, components do have some limitations.

See, unlike formatting you place in your own post, components aren’t necessarily limited to a single post on a thread. They live on the admin-side of beagle-time potentially affecting and overriding large swaths of the website.

They are powerful, but can be dangerous so at beagle-time we have three major checkpoints for implementing new components.
  1. They must be tag-specific
    They will only influence topics where the poster of that topic specifically chooses to implement that component. Site wide components can be considered, but discussion about those are for a different topic.
  2. Their code must be well documented and easily understood
    Every component needs to be approved by admin. Their exact affect on the topic and website should be clear and easy to see. If you write the component yourself, you may know exactly what it does and how it works, but if you can’t walk admin through it, it won’t be going on beagle-time because…
  3. It must not compromise the safety or performance of the site or other users
    It is possible to write a component that crashes the server or harasses a specific user or tries to harvest data from visitors to the topic. No component that would do anything close to this, intentional or otherwise, will be approved. The component may need to undergo testing on a secondary server first to demonstrate its security.

Yep. That’s basically it.

That’s what this topic is for! You can bring up a component or design you want, or even an idea you have and admin or another community member can help make it a reality. You’ll need to create a unique tag for it that either helps describe what it does, or what adventure/topic theme it is creating.

If you’re not sure if something is possible, this is also a place you can discuss that.

Current tag specific components:
TagDescription
"adventure"Formats non-op replies differently from posts by the original poster of a topic
"spider-man"Grants the post composer access to the Spider-GIF button: A gif search that has a high preference for spider-man related images
"reader-mode"Adds a button to the top of the topic stream that filters all posts except for those made by the first poster of a topic.

Update on the “adventure” tag.

The component source now has its own github at: GitHub - Rhababo/discourse-forum-adventure-style: Discourse component for formatting topics for forum adventures

Current development goals for the tag are:

  • Add post titles to each post by the topic-owner
  • Create a “Next” button that sends the reader to the next topic-owner post

(Optional)

  • Create a: “New Update” toggle for the adventure owner for when they make a new post.

If there are other features that would be helpful, post them here.


This is the wrong thread for this one I think but anyway:

Something broke and now I don’t think it’s possible to create a new topic.

New Topic window opens up but its impossible to type anything into the main body, select a category etc and you definitely can’t make the new topic.

Can confirm, I tried making a topic and nothing worked.

Thanks Ix and Lankie!

It should be fixed now.

The Spider-GIF plugin had a feature that checked for a specific topic tag before rendering (to keep them contained).

It looks like that check was running even for the composer for a new topic. But there aren’t any tags to check for when making a new topic, so the javascript crashed and just stopped loading the rest of the new topic composer.

Disabling Spider-GIF fixed the issue.

RIP Spider GIF
2023 - 2023
You messed with one of us, you messed with all of us

2 Likes

Spider-GIF has returned. They have learned not to mess with the composer when on a New Topic page. They are very sorry and wrote everyone an apology note.

They are not allowed to post the apology note here.

I’d like to introduce the “reader-mode” tag.

A thread with “reader-mode” enabled will have a button added to the top of the topic that toggles “reader mode”. Currently reader-mode just filters out all posts except for those made by the topic owner, however, it will likely get expansions in the future.

It is also enabled by default on all topics in the Forum-Adventures category.

I will admit that I spent a good two hours fighting with reader mode to have it drop you on the first post rather than the second. There are some asynchronous programming calls going on and I am currently too dumb to fix it.

I have not given up on this though. Just gotta get good.

Edit:

Reader-mode now also toggles the sidebar.

I also “fixed” the post it drops you at by having your browser wait half a second before moving you to the top post. This is not ideal, but it looks much better.

Other items on the docket for this are to have it

  • expand the reading window

  • keep the button visible while in reading-mode

  • pull-back the header

  • have it keep you on the post you are closest to when entering reading mode - in case you are reading through multiple sessions.

Reader Mode was breaking private messages, but this was fixed before it became an issue because no one had used private messages.

Formating changes with Reader Mode are ongoing. Selecting ReaderMode now removes the header and expands the post window. The max image size has been increased to 1000 x 1000 px, so images can take advantage of the extra real estate in when in Reader Mode.