Postbox Add-Ons for Friendica
Bookface 1.6 introduces a new feature called "Postboxes" that allows you to create a post with a colorful background like a similar feature on Facebook. It's built into the Bookface scheme, but I also created TWO add-ons for Friendica if a server administrator wants to roll it out for all of their users regardless of what theme they prefer.
Postbox: simply adds a minified stylesheet to the head with the Postbox styling. It doesn’t add any interface for creating a Postbox, but users can still create them manually with BBcode.
Zen Postbox: adds the minified stylesheet to the head, but also adds a tool to the post composer to insert a Postbox or wrap selected text in one.
To manually create a Postbox just wrap your text in the Postbox class BBcode like this:
[class=postbox-redblue]Text that will be wrapped[/class]
Make sure to PREVIEW it before you post it! While Friendica's Postboxes do allow more content than just plain text, certain formatting blocks can't be placed inside them.
If everything looks good, go ahead an POST it. Anyone using Bookface or any server using either the "Postbox" or "Zen Postbox" add-ons will see it like this:
If the "Zen Postbox" add-on is enabled it adds a button for wrapping/inserting a Postbox to the post editor:
Full Documentation of the "Zen Postbox" add-on is available as a GitLab Wiki.
Keep in mind that other servers that don't implement Postbox styling, other platforms (like Mastodon), and third-party apps will not show these colored backgrounds. This feature only works in the Friendica webapp/website.
This is what that post would look like in the stock "Frio" theme without the add-ons:
#bookface #friendica @Friendica Admins @Friendica Developers
Hypolite Petovan
•Pygoscelis Papua
•<span>
transfers but theclass="postbox-..."
gets stripped out. And even if the classname wasn't stripped Mastodon (or any other platform) would not have the stylesheet to show them as postboxes anyway. Much like the Facebook version that inspired them, they only work within this platform. People can always do what people do with the Facebook ones though, screencap them and share the images on other platforms. 😉Hypolite Petovan
•Pygoscelis Papua
•Hypolite Petovan
•Pygoscelis Papua
•Matthias
— (3, Kaffeetwete, Mitte, Brunswick, Lower Saxony, 38100, Germany) •@Pygoscelis Papua
Post to Bluesky
Post to tumblr
Post to e-Mail
Post to Hubzilla
Post to Diaspora
Pygoscelis Papua
•Thank you @Matthias !
Now I guess the question for the ones that are messed up is whether the problem is in how Friendica sends the post data or if it's how the platform that receives it is parsing it?
I tried looking through the Friendica code myself trying to find where post data gets processed to send to each other platform and I can't make head nor tail of it. Though I did run across a comment that
[class]
was "deprecated since 2021.12, left for backward-compatibility reasons" but doesn't way why it was deprecated. I hope it doesn't get removed because it's also how I'm making the "Cover Photos" work in Bookface.Hypolite Petovan
•Pygoscelis Papua
•Since the BBcode is replaced with
<span>...</span>
shouldn't it be trivial to simply send the wrapped content without the wrapper to other platforms?Like the difference between:
$text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '<span class="$1">$2</span>', $text);
and$text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '$2', $text);
Hypolite Petovan
•