. This page shows how to add Facebook, Pinterest, Twitter, and Google+ buttons to a catalog page.

Adding Social Buttons to Item Pages

The UltraCart catalog makes it easy to add a variety of social media buttons to your website with easy to use velocity code.

Pinterest

${item.getPinterestPin()} <br/><br/>

Place the velocity code into your item template exactly where you want the Pin It button to appear. The picture below provides an example of how it will look on a catalog.

Facebook

The Facebook Social Plugin allows for a variety of customizations to the appearance of the "Like" or "Recommend" buttons.  The first, and easiest, way to include a Like button on your page is to simply call the method with no parameters.

${item.getFacebookLikeButton()} <br/><br/>

This will render the button using Facebook's default settings, as shown below.

If you want complete control of the appearance of the Facebook Social Plugin, you will need to use the more advanced method.  Each parameter is described in detail below.

${item.getFacebookLikeButton(String layoutStyle, int width, boolean sendButton, boolean showFaces, String verb, String colorScheme, (Optional) String font)} <br/><br/>

Whew!  Now how about some examples?  First, if you wanted to create a button with all of the defaults, you could use this.

${item.getFacebookLikeButton("standard", 450, true, true, "like", "light")} <br/><br/>

This will render exactly the same as the default. What if we want it to look like this?

We would use this code:

${item.getFacebookLikeButton("standard", 250, false, true, "recommend", "dark", "trebuchet ms")} <br/><br/>

As you can see, there is a tremendous amount of flexibility in how you can configure the Facebook Social Plugin, so feel free to experiment.  You can include more than one Like button on the page, so you can easily test different settings.

Facebook will automatically crawl your page whenever a visitor clicks on your like button. If you want to suggest content to Facebook to be included in the like, you will need to use the OpenGraph meta tags. You can read more about OpenGraph on Facebook's developer site.  Actually, you'll probably find our documentation about the Open Graph protocol more useful.

Twitter

Like Facebook, the Tweet Button allows for a variety of customizations.  As before, you can create a default tweet button by calling the method with no parameters.

${item.getTweetButton()} <br/><br/>

This will render the default button, as shown below. Since the customizations also affect what content is loaded after the visitor clicks the button, the resulting popup is also shown.

The default button uses the page's title as tweet text.  You can, however, greatly enhance the results by using the more advanced option.

${item.getTweetButton(String tweetText, String countBoxStyle, String buttonSize, String viaUser)} <br/><br/>

Example time!

${item.getTweetButton("Check out this awesome gear!", "none", "large", "ultracart")} <br/><br/>

And if we actually tweet the above, here's how it would look on Twitter:

By including the via tag, you get the benefit of having your account mentioned and linked in the visitor's tweet.  Pretty neat, eh?

Google+

If you have a Google account, then you also have a Google+ account. Congrats! The Google+ Button allows for a few customizations, but it tries to be much smarter than the other buttons. We'll discuss this in a moment. To create a default Google+ Button, just call the method without any parameters.

${item.getGooglePlusButton()} <br/><br/>

To customize the appearance, use the advanced method:

${item.getGooglePlusButton(String annotationType, int width, int height, String alignment)} <br/><br/>