How to Use gigya to Share and Comments

2016/01/312 min read
bookmark this
Responsive image

Table of Contents

  1. Gigya comment module written in jade
  2. Gigya comment module written in javascript
  3. Gigya shared module written in jade
  4. Gigya shared module written in javascript

Gigya provides social share feature, include facebook, google plus's share, comment and tons of other features to engage your website and the user.

http://www.gigya.com/products/add-ons/social-engagement/

This blog shows very simple way to imprement this, first you need to go to gigya.com to register and get a account.

Once you get a account, following is simple code written by jade to add comment area.

Gigya comment module written in jade

.container
		#commentsArea
	script(type='text/javascript').
		var params ={
		categoryID: 'technology',
		streamID: window.location.pathname,
		version: 2,
		containerID: 'commentsArea',
		cid:'',
		enabledShareProviders: 'facebook,twitter,yahoo,linkedin,googleplus'
		}
		gigya.comments.showCommentsUI(params);

Gigya comment module written in javascript





      var params ={
      categoryID: 'technology',
      streamID: window.location.pathname,
      version: 2,
      containerID: 'commentsArea',
      cid:'',
      enabledShareProviders: 'facebook,twitter,yahoo,linkedin,googleplus'
      }
      gigya.comments.showCommentsUI(params);



Gigya shared module written in jade

script(type='text/javascript').
		var act = new gigya.socialize.UserAction();
		var thisUrl = window.location.href;
		var imageSrc = $("img.img-responsive")[0] || '';
		act.setTitle($("header h1").text());
		act.setLinkBack(thisUrl);
		act.addMediaItem({ type: 'image', src: imageSrc, href: thisUrl });
		var showShareBarUI_params=
		{
		containerID: 'shareDiv',
		shareButtons: 'Facebook-Like,Twitter-Tweet,googleplus-share,LinkedIn',
		userAction: act
		}
	script(type='text/javascript').
		gigya.socialize.showShareBarUI(showShareBarUI_params);

Gigya shared module written in javascript


      var act = new gigya.socialize.UserAction();
      var thisUrl = window.location.href;
      var imageSrc = $("img.img-responsive")[0] || '';
      act.setTitle($("header h1").text());
      act.setLinkBack(thisUrl);
      act.addMediaItem({ type: 'image', src: imageSrc, href: thisUrl });
      var showShareBarUI_params=
      {
      containerID: 'shareDiv',
      shareButtons: 'Facebook-Like,Twitter-Tweet,googleplus-share,LinkedIn',
      userAction: act
      }

    gigya.socialize.showShareBarUI(showShareBarUI_params);


Reference

gigya documents