I have a basic File field set up to allow my users to attach files to nodes.

However, the File field widget in the node edit form displays files as a link to the file, and the URL contains #overlay-context=. Thus when users right click to copy the URL to the file, the URL includes the overlay context, and the link doesn't work (or images don't display).

How do I stop the Overlay module from adding that on to the File URLs on the node edit form?

I have the Insert module, IMCE, and IMCE WYSIWYG bridge enabled to provide users with other options, but some users (including myself) still prefer to right click the file name and copy the URL.

1 Answer 1


The only thing I can think of offhand is to play with hook_url_outbound_alter() and make a regex to alter only the file paths url in question (not just any and all urls on the site) and strip out the context.

There might be a better way to do this ... maybe like theme_link or theme_links overridden for the given region ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.