Closed (outdated)
Project:
Textimage
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2010 at 16:21 UTC
Updated:
17 Sep 2016 at 19:09 UTC
Jump to comment: Most recent
Comments
Comment #1
decipheredHi not_Dries_Buytaert,
While what you request has merit, and I believe that the current dev already has support for the email widget, generally each widget provides a differently structured variable so a single formatter would not suffice.
What I would suggest is using the Custom Formatters module, where you can easily define your own CCK formatters as needed, giving you much more control than a module defined CCK formatter.
Here's a example email formatter I knocked up for you, after first creating a textimage called 'email'.
Name: email_textimage
Label: Email Textimage
Field Types: email
Handle multiple values: off (default)
Code:
return theme('textimage_image', 'email', $element['#item']['safe']);I'm not specifically saying that I won't expand the formatter somewhat in the future, but there a more major issues with Textimage at the minute.
Cheers,
Deciphered.
Comment #2
not_Dries_Buytaert commented@Deciphered: Thx for the email widget/ formatter example.
How could the module automatically create images from computed/ calculated fields (http://drupal.org/project/computed_field)?
Perhaps you could share with us which: variable holds the unsanitized input string for this module or handle should be used?
Really hoping you can help out with this request. :-)
Comment #3
not_Dries_Buytaert commented@Deciphered: thx to your hint, I figured out following workaround to display any type of field as an image:
Preset name: textimage_preset_name
Name: custom_formatter_name
Label: custom_formatter_label
Description: custom_formatter_description
Editor mode: Advanced
{click Next button}
Field type(s): computed
Handle multiple values: disabled
PHP:
return theme('textimage_image', 'textimage_preset_name', $element['#item']['value']);Computed Code:
$node_field[0]['value'] = $node->{user input field NAME}[0]['value'];NB: change the part between '{...}' as needed.
Data Length: {some value; I use '1024'}
Sortable: {uncheck}
NB: change the part between '{...}' as needed.
NB: change the part between '{...}' as needed.
Please, refer to these 'how to' instructions on the project webpage and/ or in the readme.
To change the extension, alt and title of the computed image, I entered following alternative code in step 3:
return theme('textimage_image', 'textimage_preset_name', $element['#item']['value'], 'png', 'MY_alt', 'MY_title');which results in following error:
Quote from project webpage:
Is this a bug and (if so) in which module?
Comment #4
mogop commentedthanks! very helpful.
when your text_image_preset doesn't have background the image is .png.
any idea how to add class to the image and same "alt" and "title" as the value?
Comment #5
mogop commentedhow to get the Suffix and Prefix? the image created is only from Value!
Comment #6
mondrake