I've been searching the theme files and module files for an hour now, and even after making a ton of changes, I cant seem to figure out how to change the format of the link when it's displayed on the from page.

Right now, it's displayed like this:

Link Titie
Submitted by nolagay on Wed, 12/24/2003 - 7:09pm. Taxonomy Category

Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text.

� add new comment | administer | tell a friend | return to Taxonomy Category | visit Link Title (2)

I would like it to display like this:

Link Titie
Submitted by nolagay on Wed, 12/24/2003 - 7:09pm. Taxonomy Category

Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. Link body text. (Visit Link (2))

� add new comment | administer | tell a friend

Notice there are no more redundant "return to" links after the body, and the link to the site has been moved to directly after the body/preview text.

Any ideas? I've been racking my brain out. I've tried things like this, in weblink.module:

// produce link
$links[] = l(t("visit link") ." "./* $link_display,*/ "newslink/goto/$node->nid", newslink_target($node)) ." (". $node->click .")";

and that did nothing.

Please someone help me? :)

Comments

nolageek’s picture

please?

skip’s picture

first off, you need to comment out (or get rid of) this a few lines up:

  if ($type == "node" && $node->type == "weblink") {
    foreach (taxonomy_node_get_terms($node->nid) as $term) {
      $links[] = l(t("return to ". $term->name), "weblink/view/$term->tid");
    }

that should get rid of the 'return to' links.

if you want the 'visit...' links to appear in the body and not the link section of the node, you need to forgo the link[] method and write a weblink_view() function.
check in the drupal hooks section of the documentation if you need help.

hope this helps.

-12

nolageek’s picture

It helps a great deal. Where can I find the "default" *_view that weblinks.module uses? I see node_view in node.module, but there's no formatting there. I checked in weblinks.module as well, but there's no _view function.

Thanks again!

Vincent

nolageek’s picture

I've played around with this, but still cant get anywhere. I cant find the "default" funtion that displays web links. What file is it in and what is it called. I cant find a weblink_view() funtion.

nolageek’s picture

Still looking for this. Sorry.. trying to wrap my head around the drupal code. Could someone point me in this direction?

skip’s picture

you will have to write a weblink_view() hook if you want to display the node differently.
It's not hard... look up the node_view() docs and experiment.

-12

eap1935’s picture

I just raised this issue with the module designer, and he's provided a patch to remove the link in the weblink.module file. He has not changed the code in CVS, however, don't know why. The relevant issue node is here:

http://drupal.org/node/view/4888

You can get the patch there. Applying the patch probably has a learning curve you don't want to climb.

The easiest thing to do is open the weblink.module file, find the weblink_link function and comment out the following three lines with forward slashes as follows:

//foreach (taxonomy_node_get_terms($node->nid) as $term) {
// $links[] = l(t("return to ". $term->name), "weblink/view/$term->tid");
//}

Hope this helps.