help using hook_url_outbound_alter() to append "#id" to node/edit url My node/edit form pages are long. When the user visits the node/edit page, I wish to direct the user toward the interesting part of that page. This part of the page has the id :   &lt;div id = "my_id"&gt;

I try to use hook_url_outbound_alter to change the path node/xxx/edit into the path node/xxx/edit/#My_id

I began testing for a specific example with the code below. But it doesn't work : the path stays as original.

function MY_MODULE_url_outbound_alter(&amp;$path, &amp;$options, $original_path) {
  if ($path == 'node/17609/edit?destination=node/17592') {
    $path = 'node/17609/edit?destination=node/17592#my_id';
  }
}


(I think that the Pathauto module could have done this but I can't install it on my website for incompatibility reason)

Thanks for your help
The $options parameter passed by reference to the hook_url_outbound_alter() implementations is described as follows. (Emphasis is mine.)


  $options: A set of URL options for the URL so elements such as a fragment or a query string can be added to the URL.


What that documentation page doesn't explicitly say is that $options is the same array url() accepts, which includes the following array indexes.


  
  'query': An array of query key/value-pairs (without any URL-encoding) to append to the URL.
  'fragment': A fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.