# Discourse-a2a-bbcode

**URL:** https://meta.discourse.org/t/discourse-a2a-bbcode/140864
**Category:** Plugin
**Created:** [February 6, 2020, 2:04pm UTC](https://meta.discourse.org/t/discourse-a2a-bbcode/140864 "2020-02-06T14:04:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![syl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/syl/32/98883_2.png) [@syl](https://meta.discourse.org/u/syl)
#### Post date: [February 6, 2020, 2:04pm UTC](https://meta.discourse.org/t/discourse-a2a-bbcode/140864/1 "2020-02-06T14:04:10Z")

</div>

# discourse-a2a-bbcode

Discourse plugin to allow inserting [AddToAny](https://www.addtoany.com/) social buttons in topics.

Repository: [https://github.com/sylque/discourse-a2a-bbcode](https://meta.discourse.org/uploads/short-url/1edMPGQvnEPmr8rcXJm6wgq6Uz4.png)

This plugin is especially useful when used with [DiscPage](https://github.com/sylque/discpage). See a demo [here](https://www.castafiore.org/t/46) on a DiscPage static page.

## Installation

Follow [those directions](https://meta.discourse.org/t/install-plugins-in-discourse/19157) using `https://github.com/sylque/discourse-a2a-bbcode.git` as the repository URL.

## Settings

- `discourse a2a bbcode enabled` : switch the plugin on/off
- `discourse a2a bbcode categories` : limit social buttons to the provided categories. Let blank to allow social buttons on any topic.

## Manual

Two bbcodes are provided:

- `abbfollow` to insert “follow” buttons
- `abbshare` to insert “share” buttons

In the composer preview pane, those bbcodes are rendered as standard html links. You need to save the topic to see the actual buttons.

### abbfollow

Inserts “follow” buttons for the specified services (see [list 1](https://www.addtoany.com/buttons/customize/follow_buttons)) and user name.

```plaintext
[abbfollow services=twitter,facebook,instagram user=Grendizer]
[/abbfollow]

```

You can omit the `services` param and provide a `href` param instead. In that case, the only feature of the button is to open the provided url.

```plaintext
[abbfollow services=email href=https://www.grendizer.com/mailing_list_form]
[/abbfollow]

```

### abbshare

Inserts “share” buttons for the specified services (see [list 2](https://www.addtoany.com/services/)). The shared message will be composed of:

- `url` param: url to share
- content of the bbcode block: title to share

```plaintext
[abbshare services=twitter,facebook,email url=https://www.grendizer.com]
I've discovered this amazing website!
[/abbshare]

```

## Sample Markdown Code

```plaintext
# AddToAny BBCode

This is a demo of **discourse-a2a-bbocde** , a Discourse plugin that allows inserting AddToAny social buttons in topics.

**Follow us:** [abbfollow services=twitter,facebook user=PCastafiore][/abbfollow][abbfollow services=email href=https://docs.google.com/forms/d/e/1FAIpQLScrkDYdIYJtnA81Oqup828qmlHIv6oTvSE6rAczwB2gsx-gDg/viewform?usp=sf_link][/abbfollow]

**Share this page :** [abbshare services=twitter,facebook,email,plus url=https://www.castafiore.org]I've discovered this amazing website![/abbshare]

```

[![](https://global.discourse-cdn.com/meta/original/3X/0/8/089dbecff9d53e4a601a590b3366597ca7992fce.png)](https://github.com/sylque/discourse-a2a-bbcode/blob/master/screenshot.png)
