Twitter Tweet

Updated on 24-May-2017 at 11:32 AM

Business Catalyst End of life announcement - find out more details.

Adding a Twitter Tweet button to your site

The first step in adding a Twitter Tweet button to your website is obtain the code for the module at dev.twitter.com . Then using the File Manager browse to Module Templates > Social Media >TwitterTweet >Default and select the container.html file. Add the code that you copied over from the Twitter website to it and hit Publish.

To add the Twitter Tweet button to your site, insert the below module:

  • For Web Pages, insert {module_twittertweet}
  • For Module Layouts such as Blogs and Web apps, insert or

    The {tag_itemurl_withhost} will use the full URL of the module item, for example http://mysite.com/module-url. The {tag_itemurl_nolink} will generate a relative URL for the module, for example /module-url

Customizing the Twitter Tweet module

This button can be customized by adding parameters to the module, for example:

See below explanation of the available parameters:

Parameter Description Values
moduleTemplateGroup This will specify a module template group, which is a folder located in FTP under /ModuleTemplates/SocialMedia/TwitterTweet/. If the parameter is not present, this will default to the Default module template (corresponding to FTP folder /ModuleTemplates/SocialMedia/TwitterTweet/Default). Any existing Folder in the /ModuleTemplates/SocialMedia/TwitterTweet/ directory
language This is the language output of the module. If the parameter is not present, this will default to en en, fr, de, it, es, ko, ja
url URL of the page to share. If the parameter is not present, this will default to the current page URL. This must be a valid URL otherwise the Twitter Tweet plugin returns error when the button is pressed Any Valid URL
count Count box position. If the parameter is not present, the default value will be horizontal. horizontal, vertical, none
text Default Tweet text. If the parameter is not present, this will default to the title of the page the button is on This can have any text value
via Screen name of the user to attribute the Tweet to Recommended to be a valid Twitter username
related   recommended to be a valid Twitter username
counturl The URL to which your shared URL resolves to (for example, in case you have used a shortened URL for the ?url? parameter) must be a valid URL

Module Template Groups

You can further customize this module by modifying the HTML mark-up using the concept of "Module Templates". Module Templates are files found within FTP that can be modified to customize your button look and feel. These module templates can be found in the /ModuleTemplates/SocialMedia/TwitterTweet/Default folder via FTP or the file manager.

Multiple templates can be used for a single button in different areas of the website. This is done by creating sub-folders within the /ModuleTemplates/SocialMedia/TwitterTweet/ directory, for example if you wanted to create a second template called 'Side-button', this will be created as below:

This folder must contain the same file(s) as that found in the Default folder. The available tags that can be used in the Twitter Tweet module templates are as below:

{tag_language} language
{tag_url} target URL
{tag_text} Twitter button text
{tag_datacount} Twitter type of count
{tag_datavia} Twitter data-via parameter
{tag_datarelated} Twitter data-related parameter
{tag_datacounturl} Twitter data-counturl parameter