Twitter App AddHovercards Function

From ADF Docs
Jump to: navigation, search

Overview

The twitterService component contains a few functions you can take advantage off in your custom scritps. One of these functions is the addHovercards function.

Setup

1. It is installed as part of the Twitter application's installation.

Demo

To set up a demo of the Follow Button custom element, follow these steps:

  • Create a new CFM file inside one of your subsite's customcf folder.
  • In this file add the following code:
<cfoutput>
<div id="hovercards">
    <h3>Hovercards</h3>
    Hover the mouse over my Twitter screen name @cvmora and the hovercard will pop up over it.
    The hovercards show the twitter pic and a button that allows you to follow me,
    or @commonspot.

    #application.twitter.twitterService.addHovercards('##hovercards')#
</div>
</cfoutput>
  • Note the ##hovercards argument sent into the function:
    • If specified, it limits the scraping to the region identified by the CSS selector passed in. It can be a Class (.selectorName) or an ID (##selectorName).
    • If left blank the hovercard function scrapes the whole page for twitter usernames.
  • Create a new page and place a Custom Script element on the page.
  • Click the 'Edit' button.
  • Select or type in the path to your new custom script.
  • Submit the changes to the page.