adamengst
(Adam C. Engst)
16 يوليو 2023، 8:43م
1
For the occasional post in our forum, I’d like to create a button that would, for instance, make it obvious what to click to register for a race, sign up to volunteer, or donate for a fundraising campaign. Just something that looks roughly like one of these:
If Discourse would take it (which it doesn’t seem to), I’d use something like this code.
<span style="display: inline-block; background-color: #7b38d8; padding: 20px; width: 200px; color: #ffffff; text-align: center;">
Button
</span>
Is there a way to do something like this on an ad hoc, individual post basis?
Thank you!
إعجاب واحد (1)
Would this work for you?
Button!
[<kbd>Button!</kbd>](google.com)
3 إعجابات
adamengst
(Adam C. Engst)
16 يوليو 2023، 9:21م
3
Thanks! It’s certainly on the right track, though I was hoping for something I could tweak with CSS so the styles would be familiar to our users from other stuff we do.
إعجاب واحد (1)
In that case, I believe this is what you need:
Introducing the amazing embedded button - the ultimate solution for spicing up your topic posts! With just a click, you can add a whole new dimension to your content and leave your readers in awe. Plus, our embedded button comes with a 100% satisfaction guarantee - if you’re not completely satisfied with its awesomeness, we’ll give you your money back (just kidding, it’s totally free)! So why wait? Get your hands on our embedded button today and join the cool kids’ club!
I have created some cal…
8 إعجابات
adamengst
(Adam C. Engst)
16 يوليو 2023، 9:39م
5
That’s exactly what I wanted, thank you! I can take it from here…
إعجابَين (2)
Canapin
(Coin-coin le Canapin)
18 يوليو 2023، 11:49ص
6
There’s a whole tutorial about how to customize posts with custom content like buttons:
Requirements
To be able to use these tips and tricks, you need to be an administrator of either a self-hosted Discourse instance or a Discourse-hosted plan higher than Basic.
Introduction
Discourse supports several methods to format and customize a post’s contents. You can find the list here:
But sometimes, you’ll want something more specific, for example, a link that looks like a button.
[Green button]
This is the kind of modification we’ll learn here.
The logic
I…
إعجاب واحد (1)
adamengst
(Adam C. Engst)
18 يوليو 2023، 6:37م
7
I saw that—thank you for writing it!
One question that’s come up—what happens with custom elements in email notifications?
Canapin
(Coin-coin le Canapin)
18 يوليو 2023، 7:06م
8
Great question
Displays as
I guess that the HTML generated with wraps won’t bring their style with them via email.
adamengst
(Adam C. Engst)
18 يوليو 2023، 7:22م
9
Good to know, thanks. It degrades well, but the text will have to be careful not to refer to it as a button, say.
إعجاب واحد (1)
MikeNolan
(Mike Nolan)
18 يوليو 2023، 7:29م
10
Can CSS be edited on a site hosted by Discourse?
إعجاب واحد (1)
On the Standard plan and up. You would create a theme component and make changes in there, and then attach that to your theme(s).
إعجابَين (2)
system
(system)
تم إغلاقه في
17 أغسطس 2023، 7:32م
12
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.