Getting Started

Installation

  1. Download LikEE.
  2. Extract the .zip file to your desktop.
  3. Copy files:
    • For EE 2.x: Copy the /system/expressionengine/third_party/likee/ directory to your /system/expressionengine/third_party/ directory.
    • For EE 1.x: Copy the /system/modules/likee/ directory to your /system/modules/ directory.

Activation

  1. Log into your ExpressionEngine control panel.
  2. Navigate to:
    • For EE 2.x: Select Add-onsModules.
    • For EE 1.x: Select Modules.
  3. Select Install in the row for LikEE.

Adding the Like or Dislike Functionality

Giving your users the ability to Like or Dislike content is easy; all you need to do is use the following tags in your template:

For EE 2.x:

{exp:likee:like entry_id="99"}
   I {like} it.
   I {dislike} it.
   {like_count} likes
   {dislike_count} dislikes
{/exp:likee:like}

For EE 1.x:

{exp:likee entry_id="99"}
  I {like} it.
  I {dislike} it.
  {like_count} likes
  {dislike_count} dislikes
{/exp:likee}

Nesting LikEE in Entries Tags

If you‘re looping through a list of entries and want to allow your users to vote on each one, just nest the LikEE tags inside your entries tag. Then you can pass the entry_id or url_title dynamically.

For EE 2.x:

{exp:channel:entries channel="your-stuff" dynamic="off"}
  {exp:likee:like entry_id="{entry_id}"}
    I {like} it.
    I {dislike} it.
    {like_count} likes
    {dislike_count} dislikes
  {/exp:likee:like}
{/exp:channel:entries}

For EE 1.x:

{exp:weblog:entries weblog="your-stuff" dynamic="off"}
   {exp:likee entry_id="{entry_id}"}
      I {like} it.
      I {dislike} it.
      {like_count} likes
      {dislike_count} dislikes
   {/exp:likee}
{/exp:weblog:entries}

Don’t Forget jQuery

Because LikEE uses AJAX calls to handle all of the liking and disliking, there is one more step. You need to add the following tag just before the closing </head> tag:

{exp:likee:js}

…and there are two optional parameters for the {exp:likee:js} tag:

skip_jquery

If you have already included the jQuery library into your page and don’t want LikEE to add another one, you can pass this parameter. The only accepted value is true.

skip_jquery="true"

ip_lockout_hours

To avoid non-logged-in users clearing their cookies and voting again, there is an ip_limit_hours parameter that can be passed to the {exp:likee:js} tag. The AJAX database update now does a quick check to make sure the user’s IP hasn’t voted on a given item in the amount of time configured here. By default this is set to 24 hours.

ip_lockout_hours="48"

Parameters

All parameters are optional unless otherwise mentioned.

entry_id, url_title, or comment_id (required)

The only parameter required to embed LikEE Like or Dislike buttons is one of the following: entry_id, the url_title, or comment_id. You can nest your LikEE tags within standard EE entries tags and pass any of these dynamically.

entry_id="23"
url_title="your-url-title"
comment_id="42"

like_text

By default, LikEE replaces the {like} tag with the word like. This parameter allows you to override that with any word you want.

like_text="love"

dislike_text

By default, LikEE replaces the {dislike} tag with the word dislike. This parameter allows you to override that with any word you want.

dislike_text="hate"

like_class

By default, LikEE adds the a class of likee_like to the anchor tags that are generated for the {like} tag. You can choose to apply your styles using this default class value, or if you prefer, you can override this class value with anything you like using this parameter.

like_class="dig-it"

dislike_class

By default, LikEE adds the a class of likee_dislike to the anchor tags that are generated for the {dislike} tag. You can choose to apply your styles using this default class value, or if you prefer, you can override this class value with anything you like using this parameter.

dislike_class="not-so-much"

Variables

{like}

The like variable creates the button that users will select to like a particular item.

{dislike}

The dislike variable creates the button that users will select to dislike a particular item.

{like_count}

The like_count variable outputs a running count of how many users have liked a piece of content.

{dislike_count}

The dislike_count variable outputs a running count of how many users have disliked a piece of content.

Variable Pairs

{remove_after_liking}

The remove_after_liking variable pair can be wrapped around any content you want removed from the DOM after a user likes or dislikes a piece of content.

Here’s an example: By default, after a user likes or dislikes any piece of content, LikEE will automatically remove the anchor tags from the DOM and put <strong> tags around the item that was liked or disliked. If you would prefer to remove all of the liking and disliking functionality, leaving only the updated like and dislike counts, you could do something like this:

{exp:likee entry_id="99"}
  {remove_after_liking}
    I {like} it.
    I {dislike} it.
  {/remove_after_liking}
  {like_count} likes
  {dislike_count} dislikes
{/exp:likee}

{show_after_liking}

The show_after_liking variable pair can be wrapped around any content you want displayed after a user likes or dislikes a piece of content.

In this example, a piece of content will only display the option to like or dislike it. Once a user makes a selection, the like and dislike totals will be displayed.

{exp:likee entry_id="99"}
  I {like} it.
  I {dislike} it.
  {show_after_liking}
    {like_count} likes
    {dislike_count} dislikes
  {/show_after_liking}
{/exp:likee}