dev-master
9999999-devYii2 extension for pinterest widgets
MIT
The Requires
by Alexander Stepanov
yii2 widget pinterest
Yii2 extension for pinterest widgets
Yii2 extension for pinterest widgets, making it easy to add Pinterest content onto your website., (*1)
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)
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]);
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', ]);
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]);
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, ]);
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, ]);
Extension is released under MIT license., (*18)
Yii2 extension for pinterest widgets
MIT
yii2 widget pinterest