_class
Add a class tag to the received HTML value --
Function
Usually, to add HTML classes to something (to make them look pretty via CSS), you use the
{{class:...}} mechanism. But that wraps the text, inside of a div or span, and while that is
usually good enough, sometimes it doesn't do everything you need. So _class provides an alternate way
to do this via QL -- given an HTML block, this adds the class to that block, instead of wrapping it
in another.
This is mainly intended for use with _edit, to do something like this:
[[My Thing -> My Prop._edit -> _class(""myClass"")]]
This will create an Edit input for My Prop, with myClass attached so you can control its display.
This can also be used to add a class to a given text block:
[[""Hello world"" -> _class(""myClass"")]]
This will create a paragraph for "hello world" as usual, but will attach "myClass" as a class on that
paragraph. (This is less often necessary, but occasionally helpful.)
If _class receives a value other than text or HTML, it will render that value, and then apply the
class to it. Therefore, this should usually be at the end of your phrase.