[support] how to handle internal links
Ray Zimmerman
rz10 at cornell.edu
Wed Jul 5 13:58:53 UTC 2006
On Jul 5, 2006, at 6:27 AM, Bèr Kessels wrote:
> I advice you to not use "hardcoded" links at all. Look at some
> filters like
> title-filter, interwiki or so. The links package (links module) has
> other
> nice links handling tools for you.
>
> That way you only store references to links (reference to the data)
> and not
> the links themselves (embedded data).
Thanks for the pointers. I agree with you in general, especially in
the case of external links. But, I would argue (though not very
strongly) that for internal data, node/99 *is* a reference to the
data that I want to be translated into a link (which depends on my
server's $base_url, path aliasing, etc). In fact, these internal
references (paths) are used all over drupal, esp. in the menu system.
However, I can't find any solutions for using these internal
references in content that appear to be supported.
title.module (http://drupal.org/project/title) - appears to be abandoned
interwiki (http://drupal.org/project/interwiki) - good for links to
specific external resources, but not internal links
links package (http://drupal.org/node/24719) - does not appear to
handle internal links, like node/99
Base Path Filter (http://drupal.org/node/58777) - does not appear to
be in contrib cvs (plus I prefer an explicit filter syntax for
internal links)
> IMO it is a bad practice to hardcode "stuff" like links, images,
> quotes, etc
> inside a node. These are 'metadata' things. Hence should live in a
> separate
> place.
>
> More pragmatic: If you have references to the data, that gets
> turned into real
> links (like [link:134]) and you choose to change your internal url
> scheme
> (pathauto) or you move your server (I recently moved from
> www.foobar/ to
> foobar/ and had to preg-replace thousands of entries) your code
> will take
> care of that change.
My point exactly. Is there an existing module that actually does
this? Ideally, I think the links package should handle this, but if
it does I missed it. Did the old weblink module support internal
links? Maybe I'll file a feature request with the links package.
Still looking for the right solution ...
Ray
More information about the support
mailing list