Skip to main content
Topic: [ADDON] Titled / Descriptive Links (Read 2715 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[ADDON] Titled / Descriptive Links

This addon will beautify links by displaying the page title instead of the url.  Should also work on internal links by changing the link to the thread title.  This one does make 2 source edits  :-X  since it adds a checkbox to the post template advanced option section to disable the function for a particular post as some links are better left as URL's

Descriptive Links v1.0

License
o This ElkArte Addon is subject to the terms of the Mozilla Public License version 1.1 (the "License"). You can obtain a copy of the License at http://mozilla.org/MPL/1.1/

Introduction
o Adds capability to automatically update links in posts to display the links website/page title instead of the url.
o Converts internal links to show the topic subject or board name as appropriate, external links to website title
o Optional length and generic name protection to avoid changing links to things like Login, Welcome, etc
o Optionally convert links contained inside of BBC URL codes
o Permissions to allow users to disable link conversion on a per post basis (under post additional options)
o Only converts links when the post is saved or modified, ensuring no performance impact during normal message viewing.

Repository / Download
http://addons.elkarte.net/enhancement/Descriptive-Links.html
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: Titled / Descriptive Links

Reply #1
 emanuele likes what he is seeing in this board! :D
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Titled / Descriptive Links

Reply #2
simple and nice addon, I like it ;)

not a critique but a little advice to make it looking better: is it possible to get the favicon of the domain near the link?
sorry for my bad english


Re: [ADDON] Titled / Descriptive Links

Reply #4
Perfect! I missed that topic ;)
sorry for my bad english

Re: [ADDON] Titled / Descriptive Links

Reply #5
Looking at places where hooks can be added. I think the edit in Post.controller.php could be done with a hook. I think it would be integrate_post_after. Maybe the JS edit as well.
I am currently doing freelance work. If you need coding help, forum help, or server maintenance, shoot me a PM and let me know.

Re: [ADDON] Titled / Descriptive Links

Reply #6
Thanks, I'll take another look at this one  :)
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: [ADDON] Titled / Descriptive Links

Reply #7
Nice one @Spuds.

Re: [ADDON] Titled / Descriptive Links

Reply #8
I guess it may be relevant here. :P

I've been asked on the Italian board if there was a way (in SMF) to incorporate moar stuff in the body (the detailed description was "like facebook", but I'm not very expert of FB so I took G+ as example) and I modified Descriptive links to obtain:
http://testing.elkarte.it/smf20/index.php?topic=3.0
 emanuele wonders if teh Spuds thinks it's something that fits the Elk addon. O:-)
Of course done a little bit better. LOL
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Titled / Descriptive Links

Reply #9
Interesting ... could add that for sure! ... maybe an option for compact or extended descriptions.

What data did you pull from the page scrape, or is it some other data that you are getting.  As you know the default is just the page title.
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: [ADDON] Titled / Descriptive Links

Reply #10
I took inspiration from G+ and first analysed the og:* meta tag title, description, url and image. Then as fallback the title tag and the first image in the page. This last one in particular is *very* prone to errors and may require some "informed decision" (in the form of avoid images smaller than, avoid images with some particular name, etc.).
I was also thinking about a max-image-size (with either cropping or just scaling) and maybe a tag to better format the whole stuff (at the moment I'm encapsulating everything into a table and... well, the result is not really up to the expectations. lol
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Titled / Descriptive Links

Reply #11
Suppose one could also look for twitter:* but Google docs don't seem to mention those.  They do talk about Schema.org data as well, but that looks like a lot to try and parse, but we would only look for it in the body tags I'd guess.

Seems just doing og: and then title as the fallback is a good choice.   I don't think you would want all of that info for a normal post where you add a link.  Maybe the option would be in the "additional" area where its something like use enhanced link snippet if available?

“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: [ADDON] Titled / Descriptive Links

Reply #12
Or: do it in a tooltip and/or only if the link is the only thing posted?
There are few variants that could be considered, yep.

Regarding what to try... well, once you have the body of the page, do one or two tests shouldn't be much of an overhead. :P
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Titled / Descriptive Links

Reply #13
Is there a way to run a script on the database to change all previously saved links in posts like the addon does? I installed it, but I wish all links till now could be changed.

Re: [ADDON] Titled / Descriptive Links

Reply #14
Thank you, I will test it.

It seems the addon has another problem with links.

http://www.sueddeutsche.de/auto/abgaswerte-renault-ruft-wegen-zu-hoher-abgaswerte-autos-zurueck-1.2824623

If I post this link in a post, it is invisible. If I edit the post then, the code is:

[url=http://www.sueddeutsche.de/auto/abgaswerte-renault-ruft-wegen-zu-hoher-abgaswerte-autos-zurueck-1.2824623][/url]