I would be quite nice to check a link to see if it ends in .pdf and if it does, add a little PDF icon.

CommentFileSizeAuthor
#3 extlink_pdf_capability.patch4.28 KBmarc.groth

Comments

quicksketch’s picture

waverate’s picture

Agreed. In the big picture, this request could be considered the same as #410688. Sorry, at the time of my post I didn't put the two of them together.

The bigger question would be, if there is no intention on adding this functionality by the maintainer, what would be your recommendation be as to how we could do this ourselves and perhaps provide this as a patch to the group. Not asking for too much code, just the area of your module to look into.

marc.groth’s picture

Version: 6.x-1.x-dev » 6.x-1.9
Status: Active » Needs review
StatusFileSize
new4.28 KB

Hi there,

Just to jump in on this request, it was something we required as well so I've gone ahead and added the code to make this functionality possible. I have attached a patch which would be great if someone could test and let me know how they get on?

The only thing that is "missing" at the moment is an actual icon of a pdf... So for now if you just put any image in the root folder called "pdf.png" then it should pick it up. The reason for this is that Drupal requires all images etc. to be GNU licensed... I found this PDF icon (http://www.adobe.com/misc/linking.html) which could be used, however I wasn't sure if you'd prefer one that is in keeping with the other styles (i.e. grey, small etc.)?

Anyway I'd appreciate any and all comments about this. Would be good if it could be adopted into the module as I'm sure others will find it useful (as evident by this thread).

Cheers,

Marc

waverate’s picture

Looks great and it works perfectly for me. For now I am using http://www.adobe.com/images/pdficon_small.gif. The only subtlety is that I have added:

  padding-left: 8px;

to the CSS however that may be particular to the image that I have used.

quicksketch’s picture

I think I'd prefer not to add this functionality. Especially considering the number of file types. The FileField module already provides icons for uploaded files for a dozen file types and showing icons is not the general purpose of this module, which is simply intended to affect external links.

marc.groth’s picture

Status: Needs review » Closed (won't fix)

Hi quicksketch,

Thanks for letting us know and for providing an alternative. I am marking this as "won't fix" as the original intention was asking for this functionality, but since it won't be included in the module it seems to be unnecessary.

I will look into the FileField module (which I think we already have installed) to achieve this.

Thanks,

Marc