Giter Club home page Giter Club logo

oc-share-plugin's Introduction

Social share plugin

This plugin adds social share features to your OctoberCMS blog post.

Installation

  1. In the backend panel, go to System -> Updates.
  2. In the box to the left of Install Plugin, type Hariadi.Share
  3. Click Install Plugin.

Social Share for Blog Post required the RainLab Blog plugin. The plugin was tested with with default demo theme.

Adding the share button

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:

Page

title = "Example"
url = "/example"

[shares]
==
<h1>Example</h1>
<p>Example how to adding share button to page.</p>
{% component 'shares' %}

Blog Post

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 %}

Manage Social Share Plugin

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" %}

Supported

  • Facebook
  • Twitter
  • Google Plus
  • .. more to come! Request

oc-share-plugin's People

Contributors

hariadi avatar

Watchers

James Cloos avatar Marco Bianco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.