Closed (fixed)
Project:
Subscriptions
Version:
7.x-1.1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Sep 2014 at 15:11 UTC
Updated:
8 Oct 2014 at 13:30 UTC
Jump to comment: Most recent
Comments
Comment #1
salvisWhat's the code used to insert the image?
Comment #2
herbiek commentedThe code used:
Comment #3
salvisSo
[subs:items:index:#0:as-node:field_news_image]gives you path to the image, right?
What does it give you when there's no image in the node?
(Try outputting the value as text, outside the <img> tag, something like
@@@[subs:items:index:#0:as-node:field_news_image]@@@)
Comment #4
herbiek commentedDepending on the email client used, you will see:
- Nothing visible of something missing (Outlook desktop):
- only the text "teaser image" (Google webmail)
- a box with the text "teaser image" (Hotmail webmail)
Can you explain what you mean with "(Try outputting the value as text, outside the
tag, something like .."?
Comment #5
herbiek commentedMaybe I understood what you meant, I put the code as suggested in my template between
(between the expected image and teaser text)
This was what the output:
Outlook: @@@@@@ and then the teaser text
Gmail: text "teaser image" , @@@@@@ and then the teaser text.
Comment #6
salvisOk, seeing the six @s means that you get an empty string if you have no image.
You can use the usual conditional expression that is documented inside the collapsed "Dynamic text information" fieldset at the bottom of the page, i.e.
{{[subs:items:index:#0:as-node:field_news_image]==?probably_nothing:<td><img ...></td>}}(Note the emptyness between
==and?: if the token returns nothing you return probably_nothing and otherwise you return your <td> element.)BTW, I'd recommend using the current -dev version...
Comment #7
herbiek commentedI've managed to test for an empty image successfully. Thanks for your help!