diff --git a/ds.field_ui.inc b/ds.field_ui.inc
index 2c1b669..1b8d397 100644
--- a/ds.field_ui.inc
+++ b/ds.field_ui.inc
@@ -27,6 +27,10 @@ function ds_field_ui_fields_layouts(&$form, &$form_state) {
   // Add the fields.
   _ds_field_ui_fields($entity_type, $bundle, $view_mode, $form, $form_state);
 
+  // Add extra fields.
+  _ds_field_ui_custom_fields($entity_type, $bundle, $view_mode, $form, $form_state);
+
+
   // Attach js.
   $form['#attached']['js'][] = drupal_get_path('module', 'ds') . '/js/ds.js';
 
@@ -1429,3 +1433,235 @@ function _ds_sort_fields($a, $subkey) {
   return $c;
 }
 
+
+
+/**
+ * Add modal for adding new fields on the fly.
+ *
+ * @param $entity_type
+ *   The name of the entity type.
+ * @param $bundle
+ *   The name of the bundle
+ * @param $view_mode
+ *   The name of the view_mode
+ * @param $form
+ *   A collection of form properties.
+ * @param $form_state
+ *   A collection of form_state properties.
+ */
+function _ds_field_ui_custom_fields($entity_type, $bundle, $view_mode, &$form, $form_state) {
+	
+	
+  // Include the CTools tools that we need.
+  ctools_include('ajax');
+  ctools_include('modal');
+
+  // Add CTools' javascript to the page.
+  ctools_modal_add_js();
+
+  // Create our own javascript that will be used to theme a modal.
+  $style = array(
+    'ds-add-field' => array(
+      'modalSize' => array(
+        'type' => 'fixed',
+        'width' => 480,
+        'height' => 480,
+        'addWidth' => 20,
+        'addHeight' => 15,
+      ),
+      'modalOptions' => array(
+        'opacity' => .5,
+        'background-color' => '#000',
+      ),
+      'animation' => 'fadeIn',
+    ),
+  );
+
+  drupal_add_js($style, 'setting');
+
+  $field_types = array();
+
+  $field_types['custom_field'] = array(
+    '#type' => 'button',
+    '#value' => t('Add a field'),
+    '#name' => 'custom_field',
+    '#weight' => -110.1,
+  );
+
+  // Dynamic field.
+  $field_types['manage_ctools'] = array(
+    '#type' => 'button',
+    '#name' => 'manage_ctools',
+    '#value' => t('Add a dynamic field'),
+    '#weight' => -100.2,
+  );
+
+  // Preprocess field.
+  $field_types['manage_preprocess'] = array(
+    '#type' => 'button',
+    '#name' => 'manage_preprocess',
+    '#value' => t('Add a preprocess field'),
+    '#weight' => -100.3,
+  );
+
+  if (module_exists('block')) {
+    $field_types['manage_block'] = array(
+      '#type' => 'button',
+      '#name' => 'manage_block',
+      '#value' => t('Add a block field'),
+      '#weight' => -100.4,
+    );
+  }
+
+	foreach($field_types as $key=>$field_type)
+	{
+
+		$form['ctools_add_field_'.$key.'_url'] = array(
+			'#type' => 'hidden',
+			'#attributes' => array('class' => array('ctools_add_field_'.$key.'-url')),
+			'#value' => url('admin/structure/ds/nojs/add_field/'.$key),
+		);
+
+		$form['ctools_add_field_'.$key] = array_merge(array(
+			'#type' => 'button',
+			'#value' => t('Add field').' '.str_replace("_", " ", $key),
+			'#attributes' => array('class' => array('ctools-use-modal')),
+			'#id' => 'ctools_add_field_'.$key,
+		) , $field_type) ;
+
+	}
+
+}
+
+/**
+ * Handles ctools modal Add field
+ * 
+ * @arg $js boolean 
+ * @arg $field_type name of the field type
+ */
+
+function ds_ajax_add_field($js, $field_type)
+{
+
+  if (!$js) {
+    // We don't support degrading this from js because we're not
+    // using the server to remember the state of the table.
+    drupal_goto("admin/structure/ds/fields/".$field_type);
+    return;
+  }
+  ctools_include('ajax');
+	ctools_include('modal');
+	
+	module_load_include('inc','ds','ds.registry');
+
+  switch($field_type) {
+
+    case "manage_ctools":
+      $form_name = "ds_edit_ctools_field_form";
+      break;
+
+    case "manage_preprocess":
+      $form_name = "ds_edit_preprocess_field_form";
+      break;
+
+    case "manage_block":
+      $form_name = "ds_edit_block_field_form";
+      break;
+
+    default:
+      $form_name = "ds_edit_custom_field_form";
+      $field_type = 'manage_custom';
+      break;
+  }
+
+	$form_state = array();
+
+  $form_state['build_info']['args'] = array();
+	
+  $form_state += array(
+    'title' => t('Add field'),
+    'ajax' => TRUE,
+    're_render' => FALSE,
+//     'rebuild' => TRUE,
+  );
+
+	$output = null;
+	form_load_include($form_state, 'inc','ds', 'ds.fields');
+	
+	/// @TODO: Shouldn't use $_POST!!
+	if(isset($_POST['ds_entity_type']) ){	
+		ds_add_field_cache_set("ds_context", array($_POST['ds_entity_type'], $_POST['ds_bundle'], $_POST['ds_view_mode']));	
+  } 
+
+	$output = ctools_modal_form_wrapper($form_name, $form_state);
+// 	dsm($form_state);
+  if ($form_state['submitted'] && !$form_state['executed']) 
+  {
+		// validation errors?
+  }
+	// field saved
+  if ($form_state['executed']) 
+  {
+		$output = array();
+
+    $arguments = ds_add_field_cache_get("ds_context");
+    // Use drupal_build_form instead of drupal_get_form.
+    $form_state2 = form_state_defaults();
+    $form_state2['build_info']['args'] = $arguments;
+
+    form_load_include($form_state2, 'inc', 'field_ui', 'field_ui.admin');
+
+    $form = drupal_build_form('field_ui_display_overview_form', $form_state2);
+  	$html = drupal_render($form);
+		/// @TODO: This creates a form_id-N, which won't work.. maybe should clear the cache somewhere?
+		$output[] = ajax_command_replace('[id^=field-ui-display-overview-form]', $html);
+		$output[] = ajax_command_restripe('[id^=field-ui-display-overview-form]');
+		$output[] = ctools_modal_command_dismiss();
+		
+		ds_add_field_cache_set("ds_context", null);
+
+		if ($messages = theme('status_messages')) 
+		{
+			$output[] = ajax_command_append('#console', $messages);
+		}
+
+
+  }
+	// !field saved
+
+
+	drupal_add_http_header('Content-Type', 'application/json');
+  print ajax_render($output);
+  exit;
+}
+
+
+/**
+ * Store our little cache so that we can retain data from form to form.
+ */
+function ds_add_field_cache_set($id, $object) {
+  ctools_include('object-cache');
+  ctools_object_cache_set('ds_add_field_cache', $id, $object);
+}
+
+/**
+ * Get the current object from the cache, or default.
+ */
+function ds_add_field_cache_get($id) {
+  ctools_include('object-cache');
+  $object = ctools_object_cache_get('ds_add_field_cache', $id);
+  if (!is_array($object)) {
+		$object = array(null, null, null);
+  }
+
+  return $object;
+}
+
diff --git a/ds.registry.inc b/ds.registry.inc
index f118302..779519e 100644
--- a/ds.registry.inc
+++ b/ds.registry.inc
@@ -182,6 +182,16 @@ function _ds_menu() {
     );
   }
 
+  $items['admin/structure/ds/%ctools_js/add_field/%'] = array(
+      'title' => t('Add field'),
+      'page callback' => 'ds_ajax_add_field',
+      'page arguments' => array(3,5),
+      'access callback' => TRUE,
+      'access arguments' => array('admin_fields'),
+      'file' => 'ds.field_ui.inc',
+      'type' => MENU_CALLBACK,
+  );
+
   return $items;
 }
 
