In D7, I needed the absolute insert,
I modify function insert_create_url($uri) like this, there is perhaps problème with stream wrapper, but in my case it works.

function insert_create_url($uri) {
  // This variable has no configuration location. It may be set by placing
  // $conf['insert_absolute_paths'] = FALSE;
  // in the site settings.php file, or by manually running variable_set().
  // For reasons why this might not do what you want and why there's no UI
  // see http://drupal.org/node/640352.
  $absolute = variable_get('insert_absolute_paths', TRUE);

  // TODO: Rewrite this function to support relative paths? Tricky because
  // not all stream wrappers support local paths at all.
  if ($absolute) {
    return file_create_url($uri);
  }
  else {
    return str_replace($GLOBALS['base_url'],'',file_create_url($uri));
  }

}

Comments

nico059’s picture

Title: suggested code a "relative" insert (as supported in D6) » Suggested code for a "relative" insert (as supported in D6)

Correction in the text
In D7, I needed the absolute insert,
In D7, I needed the "relative" insert,

quicksketch’s picture

Thanks for the update, but could you please merge with the existing issue at #1149910: drupal7 insert relative paths and mark this one duplicate?

nico059’s picture

Status: Active » Closed (duplicate)

I close this post, it's duplicate.
I copied the code in http://drupal.org/node/1149910