2017 © Pedro PelĂĄez
 

yii2-extension yii2-pinterest-widgets

Yii2 extension for pinterest widgets

image

nirvana-msu/yii2-pinterest-widgets

Yii2 extension for pinterest widgets

  • Friday, August 12, 2016
  • by nirvana-msu
  • Repository
  • 1 Watchers
  • 2 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 23 % Grown

The README.md

yii2-pinterest-widgets

Yii2 extension for pinterest widgets, making it easy to add Pinterest content onto your website., (*1)

Resources

Installation

Composer

Add extension to your composer.json and update your dependencies as usual, e.g. by running composer update, (*2)

{
    "require": {
        "nirvana-msu/yii2-pinterest-widgets": "1.0.*@dev"
    }
}

, (*3)

The full list of available widgets are: - Pin It Button - Pinterest Follow Button - Pinterest Pin Widget - Pinterest Profile Widget - Pinterest Board Widget, (*4)

Pin It Button

The Pin It button is the best way for your business to get content on Pinterest. With just one click, visitors can save content they like on your site to Pinterest, which helps even more Pinners discover you., (*5)

prop type default notes
type string 'any' enum of ['any', 'one']
large boolean not set (false) is large sized button
round boolean not set (false) is circular button

The following props are specific for type="one". Each prop refers to the Pin to be pinned on click. A new Pin will be created using media, url and description., (*6)

prop type notes
media string the image url of the Pin to create
url string the link back of the Pin to create
description string the description of the Pin to create

Note: there are more settings available than this widget currently supports. For the full description of the settings, defaults and their effect, refer to documentation., (*7)

Use:, (*8)

// To create a Pin one Pin It button
echo PinItButton::widget([
    'type' => 'one',
    'media' => 'https://goo.gl/zFFBUK',
    'url' => 'https://goo.gl/hQmcWP',
    'description' => 'Example Stuff',
]);

// To Create a Pin any Pin It Button: opens the image picker overlay
echo PinItButton::widget(['type' => 'any']);
echo PinItButton::widget(['type' => 'any', 'large' => true]);
echo PinItButton::widget(['type' => 'any', 'round' => true]);
echo PinItButton::widget(['type' => 'any', 'round' => true, 'large' => true]);

Pinterest Follow Button

The follow button lets Pinners easily follow your business’s Pinterest page., (*9)

prop type notes
board string the board slug of the board to follow (<username>/<board_name>)
user string the username of the user to follow
text string the text to be displayed on the follow button

Choose either a board or user to follow. If both are specified, board will be used., (*10)

Use:, (*11)

// To create a board follow button
echo PinterestFollowButton::widget([
    'board' => 'pinterest/official-news',
    'text' => 'Official News',
]);

// To create a profile follow button
echo PinterestFollowButton::widget([
    'user' => 'pinterest',
    'text' => 'Pinterest',
]);

Pinterest Pin Widget

Pin widget lets you show a Pin and is perfect for when you find a Pin that fits your look and feel., (*12)

prop type default notes
pin string required the id of the Pin to display
size string not set ('small') enum of ['small', 'medium', 'large']
terse boolean not set (false) whether to hide description

Use:, (*13)

// Pin Widgets default to small
echo PinterestPin::widget(['pin' => '530158187357124374']);
echo PinterestPin::widget(['pin' => '530158187357124374', 'size' => 'medium']);
echo PinterestPin::widget(['pin' => '530158187357124374', 'size' => 'large', 'terse' => true]);

Pinterest Board Widget

Board widget displays an entire board (up to 50 Pins), providing your visitors a quick taste of what your Pinterest profile's all about., (*14)

prop type default notes
board string required the board slug of the board (<username>/<board_name>)
boardWidth number not set the width of the board widget
boardHeight number not set the height of the board widget
imageWidth number not set the width of the Pin thumbnails within the widget

Use:, (*15)

echo PinterestBoard::widget([
    'board' => 'pinterest/official-news',
    'boardWidth' => 400,
    'boardHeight' => 320,
    'imageWidth' => 80,
]);

Pinterest Profile Widget

Profile widget shows the most recent Pins you’ve saved., (*16)

prop type default notes
user string required the username of the profile
boardWidth number not set the width of the board widget
boardHeight number not set the height of the board widget
imageWidth number not set the width of the Pin thumbnails within the widget

Use:, (*17)

echo PinterestProfile::widget([
    'user' => 'pinterest',
    'boardWidth' => 400,
    'boardHeight' => 320,
    'imageWidth' => 80,
]);

License

Extension is released under MIT license., (*18)

The Versions

12/08 2016

dev-master

9999999-dev

Yii2 extension for pinterest widgets

  Sources   Download

MIT

The Requires

 

by Alexander Stepanov

yii2 widget pinterest