This plugin adds social share features to your OctoberCMS blog post.
Backend Admin
- In the backend panel, go to
System -> Updates & Plugins. - Click
Install Plugin, typeHariadi.ShareorSocial Share - Choose
Social Shareand the plugin should be installed.
Console
From your October root directory, type:
php artisan plugin:install Hariadi.ShareSocial Share for Blog Post recommended the RainLab Blog plugin. The plugin was tested with with default
demotheme.
To add the plugin's share code to your website just drop the Share Component to your CMS page or blog post and add {% component 'shares' %} code to after the page/blog post tag:
title = "Example"
url = "/example"
[shares]
==
<h1>Example</h1>
<p>Example how to adding share button to page.</p>
{% component 'shares' %}
Example from RainLab Blog
title = "Blog Post"
url = "/blog/post/:slug"
layout = "default"
[blogPost post]
paramId = "slug"
[shares]
==
<?php
function onEnd()
{
// Optional - set the page title to the post title
if (isset($this['blogPost']))
$this->page->title = $this['blogPost']->title;
}
?>
==
{% if not blogPost %}
<h2>Post not found</h2>
{% else %}
<h2>{{ blogPost.title }}</h2>
{% component 'post' %}
{% component 'shares' %}
{% endif %}You can globally enable/disable social media provider in the back panel, go to System -> Settings and look for the section named Social Share. Social Share also can take parameter to override media social individually.
{% component 'shares' facebook="false" %}
To enable/disable per page/post, choose your desired provider from list in component setting.
- Google Plus
- Tummblr
- .. more to come! Request