Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sorry I keep making so many issues :) I'm correcting my own code, and I just keep finding all kinds of problems.
When a generated text image contains a slash, the output is incorrect and only shows content after the last slash. Also, HTML tags should probably be removed before showing the image. For example, a text image displaying "Are you sure you want to delete <em>My Node</em>?
shows "em>?".
Both issues contribute to this problem. The attached patch encodes slashes and removes tags.
Comment | File | Size | Author |
---|---|---|---|
#2 | textimage_strreplace.patch | 774 bytes | danielb |
textimage_path.patch | 1.29 KB | quicksketch |
Comments
Comment #1
wundo CreditAttribution: wundo commentedThis patch didn't solved the issue here. Only the things after the last "/" appears.
Comment #2
danielb CreditAttribution: danielb commentedI have also been waiting for a fix to this problem. So here it is.
Comment #3
Rowanw CreditAttribution: Rowanw commentedNeither of these patches could possibly fix the slash issue, the problem goes much deeper.
Comment #4
Deciphered CreditAttribution: Deciphered commentedUsing the theme('textimage_image', 'preset', 'text', array('additional', 'text'), 'ext'); should prevent all these issues.
Comment #5
gutomec CreditAttribution: gutomec commented@Deciphered
Can you you give me an example of using the theme('textimage_image', 'preset', 'text', array('additional', 'text'), 'ext'); in version 6.x-2.x-dev?
Comment #6
Deciphered CreditAttribution: Deciphered commented@gutomec
Sure.
In your themes template.php file, put the following snippet inside your THEME_preprocess_page() function.
That will then return a Textimage version of your page title using the Textimage preset 'page_title'.
If you require more information, please open a new support issue.
Comment #7
8manj-dupe CreditAttribution: 8manj-dupe commentedDo you also have an example for the 5x version, of the template.php over ride??
(Sorry to re-open the issue, best to provide the example here than open a brand new for such a small request, wicked module by the way, we have it working on www.huddlestone.co.uk)
Comment #8
danielb CreditAttribution: danielb commentedNot it does not. Example: Make your page titles textimage, and then delete a node - pay close attention to the "are you sure you want to delete" title.
Of course, being a theme function, it means I can preprocess the text easily and striptags myself.
Comment #9
Deciphered CreditAttribution: Deciphered commented@danielb,
Yes and no, the original issue was thus:
As you proved, this is fixed, it now shows "Are you sure you want to delete My Node?".
I will not remove the tags/slashes in the case that someone wants tags/slashes in their Textimage. If you don't want it there, you will need to filter it out before passing it to Textimage.
@MonoRob,
I would suggest trying the Textimage Autoinsert module.
And thank you for the compliments, although I can't take all the credit is I am simply the current maintainer of the module.