This plugin adds social share features to your OctoberCMS blog post.
- In the backend panel, go to
System -> Updates
. - In the box to the left of
Install Plugin
, typeHariadi.Share
- Click
Install Plugin
.
Social Share for Blog Post required the RainLab Blog plugin. The plugin was tested with with default
demo
theme.
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" %}
- Google Plus
- .. more to come! Request