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.
The title says it all. Is it possible at all?
The title says it all. Is it possible at all?
Comments
Comment #1
1mundus CreditAttribution: 1mundus commentedWell, it seems that there is an unexpected easy solution. Go to block configuration page and under Link Text choose your image token and append the img HTML tag. Here is the example:
<img src="/files/styles/thumb/public/[node:field-NAMEOFYOURIMAGECCKFIELD:file]"</img>
Comment #2
EannaC CreditAttribution: EannaC commentedI've been looking for this solution for a while, and i seems like you've got exactly what I want.
One problem.... where's the "Link Text" field? I can't see it anywhere!
Thanks
Comment #3
1mundus CreditAttribution: 1mundus commented1. Go to "Structure" - "Blocks".
2. Find your "Prev/Next links" block
3. Expand "Previous node" and "Next node" sections and there you'll see "Link text" headings.
Comment #4
michael.k CreditAttribution: michael.k commentedI've also been looking feverishly for a way to get thumbnail images to display along with the node title, but can't get your method to work. Would you mind showing what actually goes in those fields in the block?
I've tried:
<img src="/files/styles/thumbnail/public/photos/[node:field_photo_file]"</img>
and<img src="/files/styles/thumbnail/public/photos/[node:field_photo_file:file]"</img>
plus many other token combinations, but I just can't get the thumbnail image to display.
Thanks!
Comment #5
1mundus CreditAttribution: 1mundus commentedTry to remove "photos/", I didn't use that part with this token.
Try this approach:
1. Open your image processed by the image preset
2. Write down that address
3. Compare the difference between that address (full path from #2) and the path without the token (you are missing e. g..
4. test which token produces the difference from #3.
Comment #6
michael.k CreditAttribution: michael.k commentedThanks for your reply. I was finally able to get it to work after using the full path:
<img src="http://localhost/sites/default/files/styles/medium/public/photos/[node:field-photo:file]"</img>
After that, there are only 23 more characters left in the field (128 characters max), so there's not much more room for other tokens.
Anyway, once the full path worked, then I could verify these, too:
<img src="/sites/default/files/styles/medium/public/photos/[node:field-photo:file]"</img>
<img typeof="foaf:Image" src="/sites/default/files/styles/medium/public/photos/[node:field-photo:file]"</img>
Also just to be clear for others, since "medium" is the name of the preset in this case, one just needs to switch out the name of the desired preset (once it's created of course).
Comment #7
bhosmer CreditAttribution: bhosmer commented