Path

ez projects / nxc_twitter


NXC Twitter

UNIX name Owner Status Version Compatible with
nxc_twitter Serhey Dolgushev stable 1.0 4.3+, 5.x+
This project provides 4 extensions, which will integrate your eZ Publish website with Twitter.

This solution is deprecated. Please do not use for new projects. Please use http://projects.ez.no/nxc_social_networks instead!

About

Current extensions are the following

  • nxc_twitter_api - wrapper for twitteroauth (https://github.com/abraham/twitteroauth) library. It also provides a possability to get oAuth token and its required for all other nxc_twitter_* extensions.
  • nxc_twitter_feed - contains template fetch function for getting last tweets from user and home timelines. It also adds "Twitter feed" eZ Flow block.
  •  nxc_twitter_publish - workflow event type, which allows to publish object`s attribute`s content to the twitter. You can easily choose class attributes wich content will be published and set other options in workflow editing interface.
  • nxc_twitter_signin - adds Twitter Sign in button. It gives the users a possibility to login using their twitter account. When user logs in by twitter account first time content object of "User" class (with the appropriate attributes) will be created in eZ Publish 

How to install:

  1. Use git to clone the latest version from GitHub: https://github.com/brookinsconsulting/nxc_twitter
  2. Or use one of the project`s archive from Downloads section
  3. Unpack extensions which you want to use (nxc_twitter_api is required for all nxc_twitter_* extensions) to <path_to_ez_publish_root>/extension
  4. Activate unpacked extensions in eZ Publish admin (setup/extensions) interface and regenerate autoload arrays.
  5. Register twitter application at http://dev.twitter.com/apps with read and write "Access Level". Also your site`s domain should be in the "Registered OAuth Callback URL" list.
  6. Set your twitter application`s "Consumer key" and "Consumer secret" in <path_to_ez_publish_root>/extension/nxc_twitter_api/settings/nxctwitter.ini.append.phpsettings file.
  7. After the activation of nxc_twitter_api extension in the setup left menu "Twitter Settings" item will be added. Click on it and then click on the twitter icon. You will be redirected to the twitter.com. After you confirm permissions (on twitter.com) you will be redirected to eZ Publish admin and twitter oAuth tocken will be created and stored in <path_to_ez_publish_root>/settings/override/nxctwitteraccesstoken.ini.append.php file.

How to use:

nxc_twitter_feed

Now "TweeterFeed" eZ Flow block is ready for use. If you want to modify it, you should take a lookt to <path_to_ez_publish_root>/extension/nxc_twitter_feed/settings/siteaccess/eng/override.ini.append.php settings file. But if you don`t want to use this block you can use timeline and user_info template fetch functions. Examples:

{def $twitter_info = fetch( 'twitter_feed', 'user_info' )}
<p>{$twitter_info.followers_count} followers</p>
{undef $twitter_info}
{def $last_twitts = fetch(
    'twitter_feed',
    'timeline',
    hash(
       'type', 'home',
       'parameters', hash(
           'count', 5
       )
    )
)}
{def $last_twitts = fetch(
    'twitter_feed',
    'timeline',
    hash(
        'type', 'home',
        'parameters', hash(
           'screen_name', 'nxcgroup',
           'count', 5
        )
    )
)}

nxc_twitter_publish

"Publishes the message to Twitter account" workflow event type is ready for use. You can add it to your workflows and set options for this events in workflow edit interface. Workflows containing this event type should be triggered after content publish.

nxc_twitter_signin

In case, if the name of your frontend siteaccess is "eng", current extension overrides login form`s template to login form with "Twitter sign in" button. You can add

{include uri='design:twitter/signin.tpl'}

to any place of your templates where you wish to display "Twitter sign in" button. If you changed "User" content class attributes you should pay attention: "User" class should contain first_name (Text line), last_name (Text line), user_account (User account), signature (Text block) and image (Image) attributes.

This project has no reviews yet. Be the first one to review it!