diff --git a/yiid.admin.inc b/yiid.admin.inc
deleted file mode 100644
index 93e77fc..0000000
--- a/yiid.admin.inc
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-
-/**
- * YIID Admin settings form.
- */
-function yiid_admin_form() {
-  $form['node_types']['#tree'] = TRUE;
-  foreach (node_get_types() as $k => $node_type) {
-    $form['node_types'][$k]['name'] = array(
-      '#type' => 'item',
-      '#value' => $node_type->name
-    );
-
-    $form['node_types'][$k]['position'] = array(
-      '#type' => 'radios',
-      '#options' => array(
-        YIID_STYLE_POSITION_NONE => t('None'),
-        YIID_STYLE_POSITION_LINK => t('Link area'),
-        YIID_STYLE_POSITION_HEADER => t('Node header'),
-        YIID_STYLE_POSITION_FOOTER => t('Node footer'),
-      ),
-      '#default_value' => variable_get("yiid_node_{$k}_position", YIID_NODE_POSITION_DEFAULT),
-    );
-
-    $form['node_types'][$k]['type'] = array(
-      '#type' => 'radios',
-      '#options' => array(
-        YIID_TYPE_LIKE => t('Like'),
-        YIID_TYPE_LIKE_AND_DISLIKE => t('Like & Dislike'),
-      ),
-      '#default_value' => variable_get("yiid_node_{$k}_type", YIID_TYPE_DEFAULT),
-    );
-
-    $form['node_types'][$k]['style'] = array(
-      '#type' => 'radios',
-      '#options' => yiid_style_options(),
-      '#default_value' => variable_get("yiid_node_{$k}_style", YIID_NODE_STYLE_DEFAULT),
-    );
-
-    $form['node_types'][$k]['color'] = array(
-      '#type' => 'textfield',
-      '#size' => 7,
-      '#default_value' => variable_get("yiid_node_{$k}_color", YIID_COLOR_DEFAULT),
-    );
-
-    $form['node_types'][$k]['text'] = array(
-      '#type' => 'checkbox',
-      '#default_value' => variable_get("yiid_node_{$k}_text", YIID_TEXT_DEFAULT),
-    );
-  }
-
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Save'),
-  );
-
-  return $form;
-}
-
-/**
- * Theming YIID admin settings form.
- */
-function theme_yiid_admin_form(&$form) {
-  foreach (element_children($form['node_types']) as $k) {
-    $rows[] = array(
-      drupal_render($form['node_types'][$k]['name']),
-      drupal_render($form['node_types'][$k]['position']),
-      drupal_render($form['node_types'][$k]['type']),
-      drupal_render($form['node_types'][$k]['style']),
-      drupal_render($form['node_types'][$k]['color']),
-      drupal_render($form['node_types'][$k]['text']),
-    );
-  }
-
-  $header = array(
-    t('Node type'), t('Display Position'), t('Type'), t('Style'), t('Color'), t('Show text')
-  );
-
-  $output = theme('table', $header, $rows);
-
-  return $output . drupal_render($form);
-}
-
-function yiid_admin_form_validate(&$form, &$form_state) {
-  foreach ($form_state['values']['node_types'] as $k => $node_type_settings) {
-    if (!preg_match('/^#[0-9A-F]{6,6}$/', $node_type_settings['color'])) {
-      form_error(
-        $form['node_types'][$k]['color'],
-        t('@color is not a valid value.', array('@color' => $node_type_settings['color']))
-      );
-    }
-  }
-}
-
-/**
- * Submit handler for YIID admin settings form.
- */
-function yiid_admin_form_submit(&$form, &$form_state) {
-  foreach ($form_state['values']['node_types'] as $k => $node_type_settings) {
-    variable_set("yiid_node_{$k}_position", $node_type_settings['position']);
-    variable_set("yiid_node_{$k}_type", $node_type_settings['type']);
-    variable_set("yiid_node_{$k}_style", $node_type_settings['style']);
-    variable_set("yiid_node_{$k}_color", $node_type_settings['color']);
-    variable_set("yiid_node_{$k}_text", $node_type_settings['text']);
-  }
-}
diff --git a/yiid.info b/yiid.info
index 15aaa49..264dfed 100644
--- a/yiid.info
+++ b/yiid.info
@@ -1,5 +1,3 @@
-
 name = YIID
-version = 6.x-1.x-dev
 description = Add YIID Like/Dislike widget to your nodes.
-core = 6.x
+core = 7.x
diff --git a/yiid.install b/yiid.install
deleted file mode 100644
index f000792..0000000
--- a/yiid.install
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-/**
- * Implements hook_uninstall().
- */
-function yiid_uninstall() {
-  $q = db_query("DELETE FROM {variables} WHERE name LIKES 'yiid_%%'");
-  drupal_flush_all_caches();
-}
diff --git a/yiid.module b/yiid.module
index db60ffa..8195a66 100644
--- a/yiid.module
+++ b/yiid.module
@@ -1,90 +1,184 @@
 <?php
 
 define('YIID_PATH', drupal_get_path('module', 'yiid'));
-define('YIID_TYPE_LIKE', 1);
-define('YIID_TYPE_LIKE_AND_DISLIKE', 2);
-define('YIID_TYPE_DEFAULT', 2);
-define('YIID_TEXT_HIDE', 0);
-define('YIID_TEXT_SHOW', 1);
 define('YIID_TEXT_DEFAULT', 1);
 define('YIID_COLOR_DEFAULT', '#000000');
-define('YIID_STYLE_LIKE', 1);
-define('YIID_STYLE_LIKE_AND_DISLIKE', 2);
-define('YIID_STYLE_POSITION_NONE', 0);
-define('YIID_STYLE_POSITION_LINK', 1);
-define('YIID_STYLE_POSITION_HEADER', 2);
-define('YIID_STYLE_POSITION_FOOTER', 3);
-define('YIID_NODE_POSITION_DEFAULT', 0);
-define('YIID_NODE_STYLE_DEFAULT', 'like');
+define('YIID_ENTITY_STYLE_DEFAULT', 'like');
+define('YIID_TYPE_LIKE', 1);
+define('YIID_TYPE_LIKE_AND_DISLIKE', 2);
 
 /**
- * Implements hook_perm().
+ * Implements hook_permission().
  */
-function yiid_perm() {
-  return array('access yiid', 'administer yiid');
+function yiid_permission() {
+  return array(
+    'access yiid',
+   );
 }
 
-/**
- * Implements hook_menu().
+/*
+ * Implements hook_field_info().
  */
-function yiid_menu() {
-  $items['admin/settings/yiid-like-dislike'] = array(
-    'title' => 'YIID: Like & Dislike widget',
-    'access arguments' => array('administer yiid'),
-    'file' => 'yiid.admin.inc',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('yiid_admin_form')
+function yiid_field_info() {
+  return array(
+    'yiid_button' => array(
+      'label' => 'Yiid',
+      'description' => 'This field is used to display a yiid button together with your content',
+      'default_widget' => 'yiid_button',
+      'default_formatter' => 'yiid_button',
+    ),
   );
+}
 
-  return $items;
+
+/*
+ * Implements hook_field_is_empty().
+ */
+function yiid_field_is_empty($item, $field) {
+  return (isset($item['active']) && $item['active'] == 0);
 }
 
-/**
- * Implements hook_theme().
+/*
+ * Implements hook_field_validate().
+ */
+function yiid_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
+  foreach ($items as $delta => $item) {
+    if (!empty($item['active'])) {
+      if (! ($item['active'] == 0 || $item['active'] == 1)) {
+        $errors[$field['field_name']][$langcode][$delta][] = array(
+          'error' => 'yiid_invalid',
+          'message' => t('Yiid active set to a value different from 0 or 1: @value', array('@value' => $item['active'])),
+        );
+      }
+    }
+  }
+}
+
+
+/*
+ * Implements hook_field_widget_info().
  */
-function yiid_theme() {
-  $themes['yiid_admin_form'] = array(
-    'file' => YIID_PATH . '/yiid.admin.inc',
-    'arguments' => array(
-      'form' => NULL
+function yiid_field_widget_info() {
+  return array(
+    'yiid_checkbox' => array(
+      'label' =>  t('Yiid checkbox'),
+      'field types' => array('yiid_button'),
     ),
   );
+}
 
-  return $themes;
+/*
+ * Implements hook_field_widget_info().
+ */
+function yiid_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
+  $active_value = isset($items[$delta]['active']) ? $items[$delta]['active'] : TRUE;
+
+  // @todo: Should be some kind of message/help be here to link to the formatter settings for the description?
+  $element['active'] = array(
+    '#type' => 'checkbox',
+    '#default_value' => $active_value,
+    '#title' => t('Provide a yiid button?'),
+  );
+
+  return $element;
 }
 
-/**
- * Implements hook_link().
+
+/*
+ * Implements hook_field_formatter_info().
  */
-function yiid_link($type, $object, $teaser = FALSE) {
-  if ($type !== 'node') {
-    return;
-  }
+function yiid_field_formatter_info() {
+  return array(
+    'yiid_button' => array(
+      'label' => t('Yiid button'),
+      'field types' => array('yiid_button'),
+      'settings' => array(
+        'style' => YIID_ENTITY_STYLE_DEFAULT,
+        'color' => YIID_COLOR_DEFAULT,
+        'text' => YIID_TEXT_DEFAULT,
+        'type' => YIID_TYPE_LIKE,
+        'description_field' => '',
+        'image_field' => '',
+      ),
+    ),
+  );
+}
 
-  $position = variable_get("yiid_node_{$object->type}_position", YIID_NODE_POSITION_DEFAULT);
+/*
+ * Implements hook_field_formatter_settings_summary().
+ */
+function yiid_field_formatter_settings_summary($field, $instance, $view_mode) {
+  // @todo
+  return '   ';
+}
 
-  if (YIID_STYLE_POSITION_LINK == $position) {
-    return array(
-      array(
-        'title' => yiid_get_code($object),
-        'html'  => TRUE
-      )
-    );
+/*
+ * Implements hook_field_formatter_settings_form().
+ */
+function yiid_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
+  $settings = $display['settings'];
+
+  // We are in views, so it's impossible to detect the bundle/entity type of the field.
+  if ($instance['entity_type'] == 'ctools') {
+    $fields = field_read_fields();
+  }
+  else {
+    $fields = field_read_fields();
   }
+  $fields = drupal_map_assoc(array_keys($fields));
+
+  $element = array();
+  $element['description_field'] = array(
+    '#type' => 'select',
+    '#title' => t('Field to use for description'),
+    '#default_value' => $settings['description_field'],
+    '#options' => $fields,
+    '#description' => t('This is the field that will be used to display the yiid button\'s text'),
+  );
+  $element['image_field'] = array(
+    '#type' => 'select',
+    '#title' => t('Field to use for the image'),
+    '#default_value' => $settings['image_field'],
+    '#options' => $fields,
+    '#description' => t('This is the field that will be used to display the yiid button\'s image'),
+  );
+
+  $form['style'] = array(
+    '#title' => t('Style'),
+    '#type' => 'select',
+    '#description' => t('Select the yiid style how to button should be displayed'),
+    '#options' => yiid_style_options(),
+    '#default_value' => $settings['style'],
+  );
+  $form['color'] = array(
+    '#title' => t('Color'),
+    '#type' => 'textfield',
+    '#default_value' => $settings['color'],
+  );
+  $form['text'] = array(
+    '#title' => t('Text'),
+    '#type' => 'textfield',
+    '#default_value' => $settings['text'],
+  );
+  $form['type'] = array(
+    '#title' => t('Type'),
+    '#type' => 'radios',
+    '#options' => array(
+      YIID_TYPE_LIKE => t('Like'),
+      YIID_TYPE_LIKE_AND_DISLIKE => t('Like & Dislike'),
+    ),
+    '#default_value' => $settings['type'],
+  );
+
+  return $form;
 }
 
-/**
- * Implements hook_nodeapi().
- */
-function yiid_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
-  if ($op === 'view') {
-    $position = variable_get("yiid_node_{$node->type}_position", YIID_NODE_POSITION_DEFAULT);
-    if (YIID_STYLE_POSITION_HEADER == $position || YIID_STYLE_POSITION_FOOTER == $position) {
-      $node->content['yiid_widget'] = array(
-        '#weight' => YIID_STYLE_POSITION_HEADER == $position ? -1000 : 1000,
-        '#value'  => yiid_get_code($node),
-      );
-    }
+function yiid_field_formatter_settings_form_validate(&$form, &$form_state) {
+  if (!preg_match('/^#[0-9A-F]{6,6}$/', $form_state['values']['color'])) {
+    form_error(
+      $form['color'],
+      t('@color is not a valid value.', array('@color' => $form_state['values']['color']))
+    );
   }
 }
 
@@ -100,39 +194,71 @@ function yiid_style_options() {
   );
 }
 
-function yiid_get_code($node) {
-  $url   = drupal_urlencode(url("node/{$node->nid}", array('absolute' => TRUE)));
-  $title = drupal_urlencode($node->title);
-  $description = truncate_utf8($node->body, 30);
-
-  // Get first node image's URL.
-  if (strpos($node->content['body']['#value'], '<img') !== FALSE) {
-    $exp = '/.+<img.+src="([^"]+)".+/mis';
-    $img = preg_replace($exp, '$1', $node->content['body']['#value']);
-    if (
-        strpos($img, 'http://') !== 0
-        && strpos($img, 'https://') !== 0
-        && strpos($img, 'ftp://') !== 0
-    ) {
-      $img = "http://{$_SERVER['SERVER_NAME']}/{$img}";
-    }
+
+
+/*
+ * Implements hook_field_formatter_view().
+ */
+function yiid_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
+  $uri = entity_uri($entity_type, $entity);
+  $url = drupal_encode_path(url($uri['path'], array('absolute' => TRUE)));
+
+  $entity_info = entity_get_info($entity_type);
+  $title = drupal_encode_path($entity->{$entity_info['entity keys']['label']});
+
+  $description_field = $display['settings']['description_field'];
+  if ($description_field != '<None>') {
+    $description = field_view_field($entity_type, $entity, $description_field);
+    $description = $description[0]['#markup'];
   }
 
-  $lang  = !empty($node->language) ? $node->language : $GLOBALS['language']->language;
-  $type  = variable_get("yiid_node_{$node->type}_type", YIID_TYPE_DEFAULT); // Like/Like & Dislike
-  $type  = $type == YIID_TYPE_LIKE ? 'like.php' : 'full.php';
-  $style = variable_get("yiid_node_{$node->type}_style", YIID_NODE_STYLE_DEFAULT);
-  $color = variable_get("yiid_node_{$node->type}_color", YIID_COLOR_DEFAULT);
-  $color = drupal_urlencode($color);
-  $text  = variable_get("yiid_node_{$node->type}_text", YIID_TEXT_DEFAULT);
-
-  return sprintf(
-    '<span class="yiid-widget-like-dislike"><iframe scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="overflow: hidden; width: 400px; height: 30px;"'
-      . ' src="http://widgets.yiid.com/w/like/%s?cult=%s&title=%s&description=%s%s&type=%s&url=%s&color=%s&short=%d"'
-      . ' allowtransparency="true">'
-      . '</iframe></span>',
-    $type, $lang,
-    $title, $description, isset($img) ? "&photo={$img}" : '',
-    $style, $url, $color, !$text
+  $image_field = $display['settings']['image_field'];
+  if ($image_field != '<None>') {
+    $image = field_view_field($entity_type, $entity, $image_field);
+    $image = $image[0]['#markup'];
+  }
+
+  $language = $entity->language;
+  $type = $display['settings']['type']; // Like/Like & Dislike
+  $type = $type == YIID_TYPE_LIKE ? 'like.php' : 'full.php';
+  $style = $display['settings']['style'];
+  $color = $display['settings']['color'];
+  $color = drupal_encode_path($color);
+  $text  = $display['settings']['text'];
+
+  $build = array(
+    '#theme_wrapper' => 'container',
+    '#attributes' => array('class' => array('yiid-widget-like-dislike')),
+  );
+
+  $query = array(
+    'cult' => $language,
+    'title' => $title,
+    'description' => $description,
+    'type' => $type,
+    'url' => $url,
+    'color' => $color,
+    'short' => !$text,
+  );
+
+  if (!empty($image)) {
+    $query['photo'] = $image;
+  }
+
+  $src = 'http://widgets.yiid.com/w/like/' . $type;
+  $src = url($src, array('query' => $query));
+  // @todo: Shouldn't this be a theme function?
+  // @todo: Shouldn't this be css?
+  $attributes = array(
+    'scrolling' => 'no', 'frameborder' => 0, 'marginwidth' => 0, 'marginheight' => 0, 'style' => 'overflow: hidden; width: 400px; height: 30px',
+    'src' => $src,
+    'allowtransparency' => 'true',
+  );
+  $attributes = drupal_attributes($attributes);
+
+  return array(
+    0 => array(
+      '#markup' => '<iframe ' . $attributes . '></iframe',
+    ),
   );
 }
