Hi Nancy,

As asked I opened a different issue for node-theming.
What I liked about the links_weblink module, that the url was possible to place within the node-title so you got:
Node-title
Node-teaser/body
visit URL (with through node.tpl.php options to show the url itself or the node-title in this field).

See this node on my website http://www.best-information.eu/grand-hotel-belle-vue. You do not see any link (so no dirty text). But when you click on visit.. than you go immediately to the website from the url.

Could weblinks please also get the possibility for theming, especially through node-weblinks.tpl.php to show the url itself or the node-title, with the same behaviour possibilities?

As you described on /weblinks page it is looking great!
Greetings,
Martijn

CommentFileSizeAuthor
#10 weblinks_example.jpg35.61 KBnancydru

Comments

nancydru’s picture

I have been looking at the Links package and it does not do "theming" of the node. It does format it differently and does give you the option of saying "Visit" rather than showing the URL.

summit’s picture

Hi Nancy,

Sorry if it is my mistake, but I do not see the link itself, which is better when the link is ugly.
Hopefully there is a way with web links also to "masker" the link, so you see the node title, but the link is underneath, or better maybe a field which is the same as the link-text in a normal tag?

Thanks for going into this so thoroughly Nancy, very much appreciated!

greetings,
Martijn

nancydru’s picture

If you chose the option to see the URL, did it still say "Visit"?

The code to do this is not hard, but I wanted some javascript for the settings and that is turning out to be a bear.

nancydru’s picture

I have thsi all working fine except that pesky little JS problem.

summit’s picture

Hi Nancy,

Visit was hardcoded unfortunately in links_weblink. But better to have it user-choosen what word it would be to show.
Next to this, thinking about it, it would be great if the node-title and the text you see as hyperlink would be user-chosen.

So you got:
Node-title: Say "Papageno"
Url: Say "http://www.dno.nl/index.php?as=3&c=sounds&m=archive&s=28&sm=archiveSeasons"
And an option to set
Url-text: Say "Muziektheater papageno uitvoering"
So please add this as an extra field.

This way the link looks nice and the user has the ability to show the link with different text than the node-title, which is also good for SEO purposes :)

greetings,
Martijn

nancydru’s picture

Actually, for SEO purposes I think it would be better to re-use the title as that would increase the "keyword density." And doing this would require another database change, which hits a bunch of code.

I thought about adding a configurable "Visit" text. We are getting to the "settings glut" point so I'd like to find another way. And the JS problem I'm having is related to trying to better manage the volume of settings that we have.

summit’s picture

For SEO purposes it is better to not completely reuse, but be able to tune the node-title and url-text as you like.
More flexibility. The best would be an option to use or the url, or the node-title or another field.
I am not having problems with to much settings if they are valuable and effective!

Looking forward what you build from it!

greetings,
Martijn

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Active » Fixed

Okay, Martijn, I am committing this as it is now. Please test it and let us know how it does for you.

summit’s picture

Hi Nancy,

Testing this as fast as I can. What I see you added a above/underneath view option, thanks!

I would very much appreciate the possibility, may be only through theming if otherwise not possible to show a different field as link-text. See how: http://www.operas.nu/papageno is now.
The css posibilities gives a much better layout, but to get rid of the ugly link showing on the page would be great!

Are there posibilities for this. May be something like (altered which I used for another module) for node-weblinks.tpl.php:

<a href="<?php print $node->url?>" title="<?php print $node->title?>"><?php print $node->title?></a>

greetings,
Martijn

nancydru’s picture

StatusFileSize
new35.61 KB

Martijn, there are new options under "View Settings". If you choose the "Visit" option of "Link displays as", you should get what you asked for, with no URL.

summit’s picture

Status: Fixed » Closed (fixed)

YesYes! It is working thanks! Set this to closed.

Great this option to set your own visit text!
I will this weeks, very bussy, but will try also convert the bigger site best-information.eu to web links.
Let you know how the converting goes.
Thanks for implementing this feature!
greetings,
Martijn

nancydru’s picture

Status: Closed (fixed) » Fixed

Since there is valuable information in thi issue, let's let it stay visibly in the queue for two weeks, at which time it will close automatically.

To say the least, Robert and I had an interesting challenge in this one.

summit’s picture

Hi Nancy & Robert,

You guys are great!
Nancy which other module of you do I need to use now for other problems I still have on my sites...:)

greetings,
Martijn

nancydru’s picture

No, I'm not letting you near any more of my modules... ;-)

summit’s picture

Status: Fixed » Active

Hi Nancy,

Sorry to open this again. Using Weblinks Drupal 5 RC7
I finally have the node-override working with panels. So I got on Weblinks node page the possibility to show other panel-panes next to the node itself.
See www.vindtocht.nl/salsa-en-tango-weekend-maastricht. The %title is not shown anymore after "Bezoek direct" which means Visit in dutch.

I think this is because panels itself uses %title.
EDIT: May be this is connected to: http://www.drupal.org/node/213751#comment-969268
Wandering if for now, not the %title, but immidiately the node-title can be gotten or may be the title token.., so panels does't interfere with the %title..

Sorry again for opening this, but you can imagine I hit my head also to the table when I finally had panels node-override working as explained here http://drupal.org/node/206185 and terms showing and than seeing that the %title is not showing anymore...

Thanks a lot for going into it again!

greetings,
Martijn

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Does the "Visit" settings in the settings page actually say "Visit %title" -- yes "%title" must actually be there. I can't imagine why Panels would be messing with content data - this is not part of the node title to be displayed.

nancydru’s picture

sorry, posted twice

summit’s picture

Hi Nancy,

Yes the visit setting says "Visit %title". I made it now "Visit" for testpurposes as you can see on: http://www.vindtocht.nl/niet-duur-ski-hotel-bij-verbier
Panels messes somehow with the title, pagetitle module doesn't work also correct with panels.

greetings,
Martijn

nancydru’s picture

While I'm figuring out what to do, have you opened an issue on Panels?

nancydru’s picture

Martijn, do you have the Token module?

summit’s picture

Hi Nancy,

Yes, I have the token module!

greetings,
Martijn

nancydru’s picture

Good, now if you were only on 6.x... I have a working version on 6.x using Token which should avoid Panels problems; I need to back port it and create an update function.

summit’s picture

Hi Nancy,
Sorry, Panels itself is what me withhold the most going to 6. Panels is not ported yet.
And all sorts of modules I use are not on 6 yet. So sorry I have to stay on 5 for a while..
Thanks for backporting!

greetings,
Martijn

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yeah, I'm still waiting for Spam and AcidFree.

Okay, Martijn, here you go. After you download, run update.php. Then, if you have Token enabled, go to your settings and check under the "visit" text. Lots of Token toys to play with.

summit’s picture

Hi Nancy,

Yep all sorts of tokens work, except....cry,cry, the [title] token.
I will make an issue on the panels.module. Banging my head again to the table.taken a cup of coffee.
Report you back what comes out of Panels. Cry, cry...

EDIT: May be this is the case: http://drupal.org/node/213751#comment-969268
It looks like node.tpl.php doesn't have control over the node-title.
Every token works, except the title token.

I build this in my node-weblinks.tpl.php..and it didn't work also..

<div class="links"><a href="<?php print $node->url ?>"><?php print 'Bezoek direct ' . $node->title ?></a><?php print $links; ?>
</div>

but I think on Weblinks level it is fixed..or you should build a new variable, $node->weblinks-title or something than I think it will show up under panels.

Greetings,
Martijn

nancydru’s picture

Well, this is definitely a Panels problem then.

nancydru’s picture

@Martijn: Lots more tokens, including [weblinks-title] and [weblinks-title-raw]. They will be in the next -dev release.

summit’s picture

Hi Nancy,
It is not working..I also think it is a panels problem.
What I do know is that using another $node fields works!
I also have the ad module, in that module a $node->adheader is build (this is the same as the node-title) and then it works.
I build this in my node-weblinks.tpl.php..and it didn't work also..

<div class="links"><a href="<?php print $node->url ?>"><?php print 'Bezoek direct ' . $node->adheader ?></a><?php print $links; ?>
</div>

So using another $node field will work, something like $node->weblink_title next to the title.

The $node->title will not work. In panels there is a discussion this is because theme and panels want to take charge over the title.

Greetings,
Martijn

nancydru’s picture

Martijn, go into the system table and locate the Panels module and set its weight up to something like 5 - definitely higher than Web Links and Token. Hopefully that will give us a chance to grab the title before they delete it. If that doesn't work, I can add code to grab the title out of the database again. Mark the Panels issue as "critical" because it is breaking your site.

summit’s picture

Hi Nancy,

I have moduleweight installed. Panels-pages and panels have already a value of 10 both. Weblinks 0 and Token 0. I set token to 5, but no success.
I just think that the title is big issue with panels. The issue on which I replyed is already critical: http://drupal.org/node/213751#comment-971868
Will try the patch stated there asap.

Greetings,
Martijn

nancydru’s picture

Status: Fixed » Postponed (maintainer needs more info)

In token_weblinks.inc at approximately line 36 you will find $tokens['weblinks-title'] = decode_entities(check_plain($object->title));

Immediately before that line, insert:

    // Panels deletes the title (http://drupal.org/node/213751).
    if (!isset($object->title)) {
      $object->title = db_result(db_query("SELECT n.title FROM {node} WHERE n.nid=%d", $object->nid));
    }

Let me know if this takes care of it.

summit’s picture

Hi Nancy,

Success!! The code is {node} n, but thanks a lot for all your effort!!!

// Panels deletes the title (http://drupal.org/node/213751).
    if (!isset($object->title)) {
      $object->title = db_result(db_query("SELECT n.title FROM {node} n WHERE n.nid=%d", $object->nid));

It gives another query, so I think this is a temporarely solution, when Panels solves http://drupal.org/node/213751. But thanks you so much for your great support for now!!

Greetings,
Martijn

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

Fabulous. I committed that fix to both branches.

nancydru’s picture

Status: Fixed » Closed (fixed)