Social Details Google+ Widget

Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads
Thankful to Krajee!
to get more out of us.

NOTE: This extension depends on the kartik-v/yii2-krajee-base extension which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies that may be updated by composer.

This widget allows you to embed various Google+ plugins into your website.

The GooglePlugin widget supports these parameters.
  • language: string the language for rendering the plugin. If not set, defaults to en-US. For the available languages supported by Google+ plugins, refer the list of supported language codes. Note, when you set a language, it will be globally applied across all google plugins rendered on the same page.

  • type: string the Google plugin type to render. Defaults to GooglePlugin::PLUS_ONE. These can be one of the following values:

    • GooglePlugin::SIGNIN: string for embedding the Google Signin plugin.

    • GooglePlugin::PLUS_ONE: string for embedding the Google +1 button.

    • GooglePlugin::SHARE: string for embedding the Google Share button.

    • GooglePlugin::BADGE_PAGE: string for embedding the Google Page Badge.

    • GooglePlugin::BADGE_PERSON: string for embedding the Google Person Badge.

    • GooglePlugin::BADGE_COMMUNITY: string for embedding the Google Community Badge.

    • GooglePlugin::FOLLOW: string for embedding the Google Follow button.

    • GooglePlugin::HANGOUT: string for embedding the Google Hangout.

    • GooglePlugin::POST: string for embedding the Google Post.

  • clientId: string the Google Plus Client ID.

  • pageId: string the Google Plus Page ID.

  • profileId: string the Google Plus Profile ID.

  • communityId: string the Google Plus Community ID.

  • signinOptions: array the HTML attributes for the Google+ Signin Container.

  • settings: array the configuration options for each google plugin setup as key value pairs. Refer the Google plugin documentation for details on configuring each plugin.

  • options: array the HTML attributes for the main plugin. The data api attributes in this array will be automatically set based on the settings configuration.

  • tag: string the tag of the container rendering the plugin. Defaults to div.

  • noscript: string/boolean text to be displayed if browser does not support javascript. If set to false will not displayed. Defaults to Please enable JavaScript to view the comments powered by google.

  • noscriptOptions: array the HTML attributes for the noscript message container. Defaults to ['class' => 'alert alert-danger']

NOTE You can configure the GooglePlugin settings once at the social module configuration level, for defaulting it across your application, and skip it in your widget calls. For example.
// your module config
'modules' => [
    'social' => [
        // the module class
        'class' => 'kartik\social\Module',

        // the global settings for the google widget
        'google' => [
            'clientId' => 'GOOGLE_API_CLIENT_ID',
            'pageId' => 'GOOGLE+_PAGE_ID',
            'profileId' => 'GOOGLE+_PROFILE_ID',
            'communityId' => 'GOOGLE+_COMMUNITY_ID',
        ],
]

// your call in your view/layout file
echo GooglePlugin::widget([]); // will use the google settings configured in module

Click one of the Google plugin links below to view details and demo for the plugin