Hi, I would like for the title of my link to populate with the title of the webpage it points to. Has anyone done this?
What I would really like is for the link to populate the "node" title it is in with the title of of the webpage it points to, but i feel this is probably more complicated. If not though, please enlighten me :). Thanks

Comments

dqd’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.x-dev

Your request sounds like javascript to me. Maybe ask a Firefox add-on developer how bookmarking and auto titles of pages work, this could turn out a hint or direction to go and build a more specific request. Most likely this could turn to to a security issue when javascript loads something in a data field automaticly.

Let me know what you find out. Sounds quite interesting thou ...

dqd’s picture

Category: feature » support
Priority: Normal » Minor
dqd’s picture

Did you know that you can use tokens in title field module? check it out and let us know if all of your modifikation wishes came true ...

dqd’s picture

Status: Active » Fixed
dqd’s picture

Status: Fixed » Postponed (maintainer needs more info)
dqd’s picture

Status: Postponed (maintainer needs more info) » Fixed

since I told you about tokens no answer, and several tests here and there confirm that your request is possible with link module as it is designed using tokens.

fixed.

oobie11’s picture

Hey, sorry for the delayed response (been away). I am trying to have the title on the link I'm submitting be the title of the page the link points to, for example:
If I enter the link "www.google.com" the links title should be "Google".
I have looked through the tokens available, and I haven't found one that provides this. If I'm missing it, could you let me know what it is. Thanks.

dqd’s picture

.... Uhm .... ok, look ...

In your example, you must ask yourself, from where your title should know that it is capital "G"oogle while your link says "www.google.com" ?

There ought to be a function behind doing the following: "split the input where the dots are like this FIRST PART .(dot) SECOND PART .(dot) THIRD PART (so far no problem until here) and take the second part of it as title and set the first letter as capital. (possible but already quite verbosely. But the best comes now:

Now what if somebody types in by chance "maps.google.com" or "http://maps.google.de" (german Google) ?? How do explain the magic link function described above that you want to link german Google maps this time?

You should rethink your concept to fit realisticly executable web functions and programmatically logic, since there is no magic, only code. Everything else near to that could be solved with tokens. But please understand that I can't explain tokens here for you.

Thanks for understanding and I hope you will find a solution.

oobie11’s picture

Im not saying take the URL and make it the title, I'm saying take the title of the page the URL I enter points to. Another example (as if I were entering this page as the URL):

Link URL: "http://drupal.org/node/1270372"
The title of the link: "How to have the link title field auto populate with the title of the url it points to"

The title of a webpage can usually be seen in the titlebar at the top of most web browsers

dqd’s picture

Wow ... not even better.

So you want the link module to go to the page where it links to, load the page to get the content generated and read out (regex/preg_match) the title from the source code to pick up and save it in the database? Jesus!

What if the title is "How to have the link title field auto populate with the title of the url it points to?" but your title space in your node design is 150px? What if the website is temporary not available or has a 100.000 traffic load in the moment you want to save your link? What if the title changes one or two days after you have saved the link?

C'mon ... are you serious? Ok, since this is not really a practical good idea I want except that nothing is impossible and that we all try to stretch bounderies. But _If you want to build a digg kind of link service I guess you have to do a lot of individual modification by yourself and may have to write your own modules for it, since this here is a custom link storage field module. Therefore is does a lot more already than only saving the link, what it actually is supposed for ...

This module is not supposed to "scan" external content.

oobie11’s picture

Thank you Digidog, that is all I needed to know. I figured that the link module would not be able to do such things and that I will most likely have to build my own module. I am trying to do exactly what digg does in regards to submitting a link and was actually going to settle on just having the title populated. Frankly, I am surprised that there is no module available (or at least that I have been able to find) that offers this functionality.

dqd’s picture

Well, most of the features you need for that are already there (in the link module). But extraordinary functionality isn't magic, it is logic and math behind. And in certain circumstances the outcome doesn't reflect the effort very well. ( I don't know it better to say in english since it isn't my native language )

I am not sure if I hear a "certain" sound between your lines. I already build a Digg like site with Drupal, since Drupal is one of the few frameworks being able to handle such task. But you see - this is a very typical situation we can see here (what all starts with the mass of options Drupal and its module contribution community offers): many options lead to the belief that it is all just a mouse click away from me. But thats only true from the point of view from the top. Thats never true when you look behind. It is mostly work done before. This is the most reason for my respect in this community and its effort to make that possible what other systems will never be able to provide.

But it can't be possible in ALL cases. Since Digg is just Digg allone - what means there's nothing else than Digg which tries to be Digg (what all allone is really simple task to create) - Drupal has millions wishes to make possible and to bring all together under the same roof, and one of them is yours Drupal being like Digg. (What is not new if you search for Digg on drupal.org) But you don't want to use it therefore allone, you want to have "Digg" build in the rest of all your Drupal options in the framework. This is the actually problem. Since link module can't be there only for being Digg. And changing it to be Digg makes it loosing resistance and makes it very prone while running other tasks. (performance? security?)

Do you see what I try to say? I don't say that it isn't possible. I just say there are many thinks to be aware of while modifing. It doesn't sound like you were aware of them all in the beginning. Thats all.

I hope you don't get me wrong and understand what I am trying to say. I could write you 2 pages full of code how to make a Digg site with Drupal. Its simple, because Drupal makes it possible. But this is not the place here for that and I sadly also don't have the time for that. All needs its order. This issue queue is better for reporting bugs and feature requests in a outcome/effort balanced manner, since there are many out there waiting for support.

And most users of the link module (and other moduels too) with extraordinary wishes, provide some patches or code snippets and ask how to implement that. This helps the module maintainer to handle that task beside of all bug reports and commits in thier free time.

So been sad, IF you have a real realisticly and possible way to prevent all the con's I mentioned in all the posts above, which demonstate why it isn't an optimal task for the link module, and IF you have a code snippet showing all the pro's and good points how and why to get that inserted in link module, I will provide you my free time to implement it, fix it, test it and to commit it with credits to your work in the next link module release.

I think this is a fair offer. What do you think?

dqd’s picture

If you like, please contribute to a general discussion about link module handling Digg like options here -> #1295160: Options and tools to create Digg like site

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ken hawkins’s picture

@oobie11 You can do this as described in this Link module issue post #1295160