diff -urp composite.module composite.module
--- composite.module	2009-09-11 23:56:17.000000000 -0700
+++ composite.module	2009-10-28 15:55:04.000000000 -0700
@@ -385,13 +385,34 @@ function composite_form_alter(&$form, $f
           '#default_value' => variable_get('composite_advanced_view_' . $node_type, '--'),
           '#description' => t('Choose the "Views module" view that selects the nodes that can be referenced.<br />Note:<ul><li>Only views that have fields will work for this purpose.</li><li>This will discard the "Content types" settings above. Use the view\'s "filters" section instead.</li><li>Use the view\'s "fields" section to display additional informations about candidate nodes on node creation/edition form.</li><li>Use the view\'s "sort criteria" section to determine the order in which candidate nodes will be displayed.</li></ul>'),
         );
-        $form['composite_extra_config']['composite_nodes']['advanced']['composite_advanced_view_args'] = array(
-          '#type' => 'textfield',
-          '#title' => t('View arguments'),
-          '#default_value' => variable_get('composite_advanced_view_args_' . $node_type, ''),
-          '#required' => FALSE,
-          '#description' => t('Provide a comma separated list of arguments to pass to the view.'),
-        );
+        if (module_exists('token')) {
+          $form['composite_extra_config']['composite_nodes']['advanced']['composite_advanced_view_args'] = array(
+            '#type' => 'textfield',
+            '#title' => t('View arguments'),
+            '#default_value' => variable_get('composite_advanced_view_args_' . $node_type, ''),
+            '#required' => FALSE,
+            '#description' => t('Provide a comma separated list of arguments to pass to the view, or add a token to be used as the argument.'),
+          );//token_replace($output, 'node', $node);
+          $form['composite_extra_config']['composite_nodes']['advanced']['composite_advanced_view_args_tokens'] = array(
+            '#title' => t('Replacement patterns'),
+            '#type' => 'fieldset',
+            '#collapsible' => TRUE,
+            '#collapsed' => TRUE,
+            '#description' => t('Prefer raw-text replacements for text to avoid problems with HTML entities!'),
+          );
+          $form['composite_extra_config']['composite_nodes']['advanced']['composite_advanced_view_args_tokens']['help'] = array(
+            '#value' => theme('token_help', 'node'),
+          );
+        }
+        else {
+          $form['composite_extra_config']['composite_nodes']['advanced']['composite_advanced_view_args'] = array(
+            '#type' => 'textfield',
+            '#title' => t('View arguments'),
+            '#default_value' => variable_get('composite_advanced_view_args_' . $node_type, ''),
+            '#required' => FALSE,
+            '#description' => t('Provide a comma separated list of arguments to pass to the view.'),
+          );
+        }
       }
     }
     $layout_sets = composite_sets_select();
diff -urp composite.node.inc composite.node.inc
--- composite.node.inc	2009-03-02 16:39:05.000000000 -0800
+++ composite.node.inc	2009-10-28 17:01:37.000000000 -0700
@@ -117,6 +117,9 @@ function _composite_nodes_form_get_poten
 
   if (module_exists('views') && $view_name != '--' && $view = views_get_view($view_name)) {
     $view_args = variable_get('composite_advanced_view_args_' . $node->type, '');
+    if (module_exists('token') && strpos($view_args, "]") > 0) {
+      $view_args = token_replace($view_args, 'node', $node);
+    }
     $view->set_arguments($view_args ? explode(',', $view_args) : array());
     $result = $view->execute_display();
     $results = $view->result;