CPN: Replacing tokens in physical css/js files Hi I have some css / js attached to a box with Code Per Node. CPN creates physical files for the code. In hook_preprocess_node I can see the CPN output, for example:

$vars['cpn']['css'] = token_replace($vars['cpn']['css']);
$vars['cpn']['js'] = token_replace($vars['cpn']['js']);


This successfully replaces the tokens in memory but the physical file is loaded up in the header and so the tokens aren't replaced in there and cause an error. Any ideas?

Thanks
Both drupal_add_js and drupal_add_css have an option to add code "inline".  You can try his in a template_preprocess_node:

function mytheme_proprocess_node (&amp;$variables)
{
  drupal_add_js($variables['cpn']['js'], 'inline');
  drupal_add_css($variables['cpn']['css'], 'inline');
}


If you do this in a theme, then the CPN hook should have already been fired.  If you do it from a module, you may need to play with the module weights to get yours to follow.