Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm creating a directory of useful (web based) resources for a community. I'd like to use Drupal 7, but can use Drupal 6 if absolutely necessary. I don't mind installing any additional useful modules.

I'd like to create a node with a link field that stores the URL of the useful resource.

I'd like to display a screenshot of this URL, using WordPress's mshots feature, as part of the node.

So, as an example, the value of the link field would be:

http://mashable.com/guidebook/twitter/

Within my content type template, or as an image field, or however you suggest I do it, this URL would need to be encoded and inserted into an image SRC value to give:

http://s.wordpress.com/mshots/v1/http%3A%2F%2Fmashable.com%2Fguidebook%2Ftwitter%2F?w=500

Which shows a 500px wide screenshot of that URL.

What do you think would be the best way of doing this? I could use 'rewrite the output of this field' in Views, but I'd like the screenshot to be shown in the node view too.

share|improve this question
    
Sorry for butchering those URLs with the space after the http:// but as a user without any built up reputation points I'm not allowed to post more than one link per post, even if they're automatically generated links. –  Phil Apr 7 '12 at 16:44
add comment

1 Answer

up vote 0 down vote accepted

You could use a custom 'screenshot' formatter for the link field. Further info for D6 and D7.

share|improve this answer
    
Thanks for this suggestion - I will look into it and mark as an answer if appropriate. http://drupal.org/project/custom_formatters looks useful for me too. –  Phil Apr 7 '12 at 17:18
    
Or metaltoad.com/blog/drupal-7-tutorial-creating-custom-formatters if I go down the module route. I like the idea of creating a module which I could contribute back to the Drupal community. –  Phil Apr 7 '12 at 17:22
    
Thanks Andy, I've just set up a custom formatter using the custom_formatters module. –  Phil Apr 8 '12 at 17:25
    
There's a Ctools friendly export at pastebin.com/umVscAnH for anyone trying to do something similar to this. –  Phil Apr 8 '12 at 17:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.