Is it possible to add code in the “Create a New Topic” text box? I have coded a calendar sign-up that I was hoping to embed, so every person who posts a new topic can fill it out. Thanks so much!
Check out Topic Templates. They’re a per-category setting
Thanks a lot for the response! Do you know how to have it take my code? It’s just takes it as text.
Ah, well if you want to actually embed code in a post then the other app needs to be supported by Onebox, which is outside my knowledge. Not so simple.
For now, you’d have to settle for a link.
Sorry for the elementary question, but you mean just a hyperlink, right?
If you want to be able to post actual code and you aren’t concerned about the possibility of it being abused, you can “white-list” tags-attributes. eg.
Discourse.Markdown.whiteListTag("progress", "class", /d-prog/); Discourse.Markdown.whiteListTag("progress", "max", /[0-9\.]+/); Discourse.Markdown.whiteListTag("progress", "value", /[0-9\.]+/);
The regex is what attribute values are acceptable.
Thanks so much for the reply! Could you explain that a little more, I’m not familiar with "white-list’ tags-attributes. The code I’m want to embed/add is a sort of calendar planner in HTML and Ruby.
It’s a plugin. For example
You would need to add a line for every tag / attribute you want to whitelist.
And be careful with the regex, it can look deceptively easier than it is to craft a good one.