A CraftCMS Twig template plugin that links social @usernames and #hashtags in blocks of text.
To install Link Social, follow these steps:
- Download & unzip the file and place the
linksocial
directory into yourcraft/plugins
directory - -OR- do a
git clone https://github.com/shealan/linksocial.git
directly into yourcraft/plugins
folder. You can then update it withgit pull
- Install plugin in the Craft Control Panel under Settings > Plugins
- The plugin folder should be named
linksocial
for Craft to see it. GitHub recently started appending-master
(the branch name) to the name of the folder for zip file downloads.
Link Social is tested on Craft 2.4.x and Craft 2.5.x.
Linksocial is a super simple plugin to link usernames and hashtags in blocks of text. It currently supports Twitter and Instagram.
Add the following pipe to any text content and set the option to twitter or instagram to ensure links point to the right place. Eg:
{{ entry.tweet | linkSocial('twitter') }}
Note: Linksocial will strip HTML tags from this text before adding it's own, so formatting will be lost. Tweets and Instagram posts don't have any formatting options so it shouldn't be an issue.
Some things to do, and ideas for potential features:
- Add option to link to current page or new window (currently new window only).
- Initial release
Brought to you by Shealan Forshaw