v4 Global Configuration (window.pwidget_config)

Follow

These options take effect on all the widgets of a page

Example

Here is a setting that disables the copy-paste feature and share Text feature, but enables share popups and a custom twitter handle:

<script>
window.pwidget_config = { copypaste: false,
shareQuote: false,
defaults: {
shareNewWindow: true,
services: {
twitter: {
via: 'Example'
}
}
} };
</script>

 

Main Settings

To setup the Global options, you will need to create this JavaScript variable. Just copy the following code into your page inside <script></script> tags (place this before the closing </head> tag):

var pwidget_config = {
    // main settings
};

Now you can add settings and their values into the //main settings section: 

track

Key NameDefault valueTypeDescription
publisherKey   String The unique key tied to a profile in your Po.st Dashboard
locale en-us String Language settings. Read more
theme default
default custom name
Template setup at the global widget level.
If you enter a value other than default, only basic styles will be loaded.
sticky false
true false object
Floating widget description. The floating widget is enabled by setting this value to true, or through the constructor.
requestConfig true
true false
requestConfig can be set to false to avoid calling the Po.st server to get your configuration. In this case all settings should be set manually.
clean false
true false

Setting this value to true disables the CSS HTTP request loading Po.st without styling.

copypaste true
true false
A global setting for the Copy/Paste functionality. Read more
copypasteOptions
Key Name
Default Value
Possible Values
Description
minWords 7 Numbers

Minimum words necessary for copypaste initialization

readMoreText 'Read more at {link}'
Type
Description
Custom text '{link}' won't added in the end of text
Boolean

true -> 'Read more at {link}'

false -> ''

Custom text that appears during copying

readMoreUrl Page Url Custom Url

Custom page url

imageSize

 

 

 

 

 
[100, 100]

 

 

 

Array(width, height)

Minimum image size necessary for copypaste initialization

Object Various options to control and customize the copypaste functionality.
shareQuote true
true false
Enable/disable the small sharing widget that appears when a user copies text.
shareQuoteOptions
Key Name
Default Value
Possible Values
Description
buttons undefined Array of services names to show

List of buttons that appear in sharequote pop-up

morePopupExclude undefined Array of services to exclude

List of services to exclude from expanded sharequote sharing window

trigger 'copy' String 'copy' or 'select'

Event triggering sharequote  pop-up. Text copy or select

object Various options to control and customize the shareQuote functionality.
onload undefined function Function that is triggered during html widget or server widget load
track true
true false 'query'
Option specifying how and if the tracking parameter should be added to the page URL.

true - #tracking parameter is added.
  http://yoursite.com#tracking.01

query - ?tracking parameter is added.
  http://yoursite.com?tracking.0

false - nothing is added.
trackAddressBar false
true false
If track is set to true you can enable this feature to add the tracking parameter to your address bar URL to allow clickback tracking.
googleAnalytics false
true false
Enable to send events and social interactions to Google Analytics.
googleAnalyticsOptions
Key Name
Default Value
Possible Values
Description
gaTrackingId undefined 'id' или ['id','anotherid']

List of IDs to send events into.

trackEvents true
true false
 
trackSocialInteractions false
true false
 
trackOptions
Key Name
Default Value
Possible Values
nonInteraction false
true false
pagePath undefined String with page path
   
object Various Google Analytics options to control information you would like to see in the Google Analytics Dashboard.

Defaults settings.

Define default widget settings. These are settings wrapped inside a classification of defaults. 

window.pwidget_config = {
    defaults: {
        // defaults settings
    }
};

You can add settings and their values into the //defaults settings section:

 

KeyDefault valueType

Description

url current page URL String

This setting can be used to share a specific URL instead of the current page.

image   String

Whenever this parameter is set, image URL specified in here will be transmitted to services that support image sharing.

title current page title String

Whenever this parameter is set, the current page title will be replaced in services that support custom titles.

layout horizontal
horizontal vertical

Parameter defining widget layout.
horizontal - horizontal widget view
vertical - vertical widget view

radius square
square rounded circle 0 - 99999

Radius Setting (does not affect native buttons)
square - Corners will not be rounded
rounded - Corners will have a 5px rounded edge
circle - Round icons
0-99999 — Use an integer in the range from 0 to 99999 to customize the amount of rounding applied.

size 32
24 32 48 64

Widget buttons size. (does not affect native buttons)

counter false
true false vertical horizontal

Setting to enable counters for each button (not all buttons support counters)
true - counters are enabled and layout affects their view
false - counters are disabled
vertical - counters in vertical view
horizontal - counters in horizontal view

label false
true false

Ability to display the channel name next to an icon inside of a button.

padding false
true false 0-99

Spacing between buttons.
true - Adds a 5px spacing between buttons.
false – No spacing between buttons.
0-99 — Using an integer in the range from 0 to 99999 to customize spacing between buttons.

view auto
auto full

auto - predefined button size and button spacing.
full - buttons will stretch to fill the size of the container they are in.
(This feature only works for Horizontal arrangements) If using the jumbo counter in full view it has fixed width and does not extend.

buttonColor default

Ability to set color for icon and button text.
default - Standard social channel colors.
HEX Color - #000000
RGB(A) Color - rgb(193, 66, 66) or rgba(255,0,0,0.3)

buttonBackground default
default none HEX Color RGB(A) Color

Ability to set color for the button background.
default - Standard social channel colors.
none - Removes background color to leave only the icons and text.
HEX Color - #000000
RGB(A) Color - rgb(193, 66, 66) or rgba(255,0,0,0.3)

hover false
true false

Enable button hover effect.
Valid for desktops only (not for mobile devices).

transformations
Key Name
Default Value
Possible Values
tracking true
true false
shorten false
true false
   
afterShareOptions
Key Name
Default Value
Possible Values
tracking true
true false
shorten false
true false
  If you would like to use the after share unit please contact support@po.st
handlers
Key Name
Default Value
Possible Values
Description
onshare undefined Function

Function triggered upon sharing.

onshowaftershare undefined Function

Function triggered before aftershare window shows.

onhideaftershare undefined Function

Function triggered upon aftershare window hiding.

onbuttonclick undefined Function

Function call on channel button click.

  A series of functions available for you to customize that are triggered by sharing events.
shareNewWindow true
true false

When this value is set to true sharing will occur in a new browser tab. When set to false shares will occur in a popup window.

stickyPopup false
true false

ShareWindow is fixed during page scrolling.

services
Key Name
Default Value
Possible Values
Description
twitter
Key Name
Default Value
Possible Values
Description
via po_st String

Twitter via sharing setup.

   
 

Various channel options

popup
Key Name
Default Value
Possible Values
Description
click true
true false

ShareWindow call on "more " button click or on hover. 

services
Key Name
Default Value
Possible Values

display (ex p_share_popup

and more_popup)

undefined

Array with services

to display on popup

exclude undefined

Array with services

to exclude from popup

   
openDelay 200 (ms) Number

ShareWindow open delay on button hover.

hideDelay 1500 (ms) Number

ShareWindow hide delay on cursor lost.

Sharing systems pop-up

opens default in the center for :

a. Mobile devices
b. ShareQuote
c. Sticky (floating) Widget.

openDelay, hideDelay - used only by click:false
 
jumbo false
true false

Enable/Disable the Jumbo counter.

jumboPosition first
first last

Determines the position of the jumbo counter.

first - To the left of horizontal or above vertical buttons
last - To the right of horizontal or below vertical buttons

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk