Git Product home page Git Product logo

wn-share-plugin's Introduction

Share

plugin cover

Share Buttons - plugin for Winter CMS. Plugin component displays share buttons.

Инструкция на русском языке: https://github.com/WebVPF/wn-share-plugin/wiki

Installation Сomposer:

composer require webvpf/wn-share-plugin

Social Networks and Messengers:

  • Facebook
  • Twitter
  • VK
  • Odnoklassniki
  • LinkedIn
  • Telegram
  • Viber
  • WhatsApp

Features:

  • easy setup
  • opens in a popup window or smartphone app
  • not blocked by adblockers
  • SVG icons are used for buttons, so there are no dependencies on icon fonts
  • no external links
  • there is no interaction with database
  • optimized javascript file less than 1 Kb
  • without jQuery

Selecting and Sorting Buttons

Specify the id of the buttons that you want to display, separated by commas (fb, tw, vk, ok, in, tg, vb, wa)

Component Share Buttons

In this case, you can specify the order in which the buttons will be displayed.

You can do a similar layout:

<div>Share: {% component 'ShareButtons' %}</div>

or

<div class="container">
    <h3>Share</h3>
    <div>{% component 'ShareButtons' %}</div>
</div>

Button Style

Silver

Silver

Color

Color

With text

With text

Simple settings are available in the component settings.

Disable css

You can completely disable predefined css in component settings. Styles can be placed in css themes or wherever convenient for you.


Paste buttons

If you work with code, you can insert buttons as follows:

[ShareButtons]
btns = "fb, tw, vk, ok, in, tg, vb, wa"
css = 1
skin = "text"
==
<div>Share: {% component 'ShareButtons' %}</div>

Buttons:

  • fb - Facebook
  • in - LinkedIn
  • ok - Odnoklassniki
  • tg - Telegram
  • tw - Twitter
  • vb - Viber
  • vk - VK
  • wa - WhatsApp

CSS:

  • 1 - enable
  • 0 - disable

Skins:

  • silver
  • color
  • text

Function share

You can call the share() function from within your scripts.

share(id, paramsUrl);
Parameter Type Required Description
id string Yes Social network ID (fb, tw, vk, ok, in, tg, vb, wa)
paramsUrl object No Can have search and hash options.

Examples

The following example will send a page link to the Telegram messenger.

share('tg');

// https://example.com/slug

search parameter

Part of the address after ?

share('wa', {search: 'a=2&b=3'});

// https://example.com/slug?a=2&b=3

hash parameter

The part of the URL that comes after the pound sign '#'

share('wa', {hash: 'anchor'});

// https://example.com/slug#anchor

search and hash parameters

share('wa', {search: 'a=2&b=3', hash: 'anchor'});

// https://example.com/slug?a=2&b=3#anchor

wn-share-plugin's People

Contributors

webvpf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dheia

wn-share-plugin's Issues

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.