Closed (fixed)
Project:
Links Package
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Mar 2006 at 21:53 UTC
Updated:
1 Apr 2006 at 20:46 UTC
The input filter does not seem to work at all for me using the raw URL form such as:
[weblink:http://example.com/]
That is, the above text appears as-is in the output.
Comments
Comment #1
syscrusher commentedThis feature simply wasn't implemented yet; it was stubbed off in the code. It's implemented now, though, and I've committed the change to CVS. Please update to the latest version from HEAD branch and give it a try, and let me know if it works okay for you.
Scott
Comment #2
syscrusher commentedComment #3
RayZ commentedWorks fine now. Thanks.
Don't know if this is documented anywhere, but it looks like if the link is already in the {links} table it generates a link to something like http://example.com/path2drupal/links/goto/0/[lid] or http://example.com/path2drupal/links/goto/[nid]/[lid]. If not, it does not create an entry in the {links} table, but rather just puts the URL directly in the anchor tag (no tracking of clicks).
Just curious, was this an intentional design choice or a case of "not yet implemented"?
Comment #4
syscrusher commented> Just curious, was this an intentional design choice or a case of "not yet implemented"?
Very definitely an intentional design choice. I think it will make sense if you think it through:
1. The filter needs to be active during edit previews as well as during actual node display. Do we *really* want to actually add a database record for every iteration of a preview, if the editor happens to fat-finger the URL? That would result in a lot of bogus, unreferenced URLs in the {links} table.
2. This filter doesn't actually create a node reference for a link, that is, an entry in {links_node}. Since it isn't adding to {links_node}, it shouldn't really add to {links}, either. Again, the issue is unreferenced extraneous links with no way for the site admin to clean them up later because they wouldn't realize these are "used by a filter" but not really attached to the node where the filter tag appears.
3. To truly attach a node to one or more links, with proper references in the {links} and {links_node} tables, is really the job of links_related.module.
4. The fact that the [weblink:$url] syntax is supported at all is really kind of a "target of opportunity" feature. It was created to allow users that don't have access to the HTML anchor ("A") tag -- due to input format restrictions -- to still embed URLs in a way that's perceived (possibly not truly) as safer. The core functionality of the filter is [weblink:$nid/$lid] or [weblink:$nid] or one of these with the optional title text. So when this extra "luxury feature" of [weblink:$url] is used, it should be minimal-impact under the covers.
By the way, you might find it interesting to know that the so-called "weblink filter" is actually going to be refactored out of links_weblink.module and into links.module in the next release. There is no reason why the $nid/$lid syntax (or the $url syntax, for that matter) is limited just to weblinks -- it could also work for related links. So I'm going to generalize the syntax rule to support "weblink", "link", "weblinks", or "links" as the keyword, interchangeably, to make things simple for the user. "link" will be the documented and preferred syntax (e.g., "[link:$nid/$lid|$title_text]"), but I'll continue to support "weblink" for backward compatibility.
Also, you may have noticed that you can now directly reference a link ID without an associated node ID, by using a zero for $nid in the link syntax.
Hope this helps. Further questions or comments are, of course, welcome.
Scott
Comment #5
RayZ commentedYes. These explanations really do help. And I agree that your design choices make sense. Thanks.
Comment #6
(not verified) commented