[drupal-devel] [feature] Handle full URLs in url() and l()

mathias drupal-devel at drupal.org
Mon Jan 24 20:06:28 UTC 2005

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  jhriggs
 Updated by:   mathias
 Status:       patch
 Attachment:   http://drupal.org/files/issues/external_urls.patch (838 bytes)

Revisiting this issue one year later shows we're almost there. The only
thing that's left is the ability to handle external urls when
clean_urls is disabled.  Once implemented, menu.module can happily
accept external urls and not just Drupal paths, making the menu system
much more attractive to end users.

I'll update the menu.module docs if this patch (or an alternative
solution) is accepted.


Previous comments:

September 16, 2004 - 10:01 : jhriggs

Attachment: http://drupal.org/files/issues/full_url.patch (1.97 KB)

This little patch allows full URLs to be used for the url() and l()
functions, giving modules a single interface for creating links. 
Currently, modules must use l() for drupal links and raw HTML for
external links.  This patch changes url() to handle -- basically pass
through -- full URLs while still doing the proper handling of internal
paths and works with clean URLs enabled or disabled.  It also shortens
(and hopefully simplifies) the url() code a bit.

Some examples of calls that now work:


September 30, 2004 - 06:09 : moshe weitzman

+1. less HTML in code is a good thing for readability, if nothing else.

View: http://drupal.org/node/10888
Edit: http://drupal.org/project/comments/add/10888

More information about the drupal-devel mailing list