This is nice.
If you start then outputting the urls and do custom theming, some more flexible theme functions are missing.
It would be pretty crazy to have some other websnapr module again for this, and the keys/settings should be setup once only..
With current code it is impossible to show node view if a user clicks on the thumbnail.
I'd suggest adding generic websnapr theme functions (almost similar like theme('image' ..) to be useable in .tpl.php files for individual output such as:
... hook_theme:
'websnapr_field_image' => array(
'arguments' => array(
'url' => NULL,
'size' => 'small',
'alt' => '',
'title' => '',
'attributes' => '',
),
Are you interested in this? We could also put more generic non-directly-field-related stuff into websnapr.project... But this project focusses much more on preview bubbles instead of generic websnapr support. How about you?
Comments
Comment #1
alfaguru commentedOK, it took me a little while to see what you are getting at, but I think you are asking me to change the line in websnapr_field_field_formatter() that reads:
$image = theme('image', $websnapr_url, $title, $title, array('height' => $height, 'width' => $width), FALSE);
to eg:.
$image = theme('websnapr_field_image', $websnapr_url, $title, $title, array('height' => $height, 'width' => $width), FALSE);
and provide a default implementation which can call theme('image'...). Is that it?
Comment #2
miro_dietikerIndeed.. if you like to change it internally also, yes.
The primary aim is to have a simple function in theming to be able to call ..
echo theme('websnapr_field_image', "example.com");
.. to output a websnapr image of example.com.
Note the second param is NOT containing nor websnapr URL nor key. It is getting added inside this theme function.
Comment #3
alfaguru commentedNow I am more confused. Do you want a general-purpose theming function that can be called from anywhere, or more flexibility in theming the output from this module? It would be clearer if you were to propose a patch, as I really don't understand what it is you want.
Comment #4
alfaguru commentedOK, after rereading what you've written I think I get it ... not sure how quickly it can be done though, so if you have a patch or sample code it would be much appreciated.
Comment #5
danepowell commentedI think this might be working in dev now... anyway I think this is a dupe of #999074: theme_websnapr_field_formatter