In the documentation of the Subscriptions module I see that it is possible to include the tag text that is added to an Image. In my case it displays:
News Image [node:field-news-image:?] Field "field_news_image". The following properties may be appended to the token: file (The image file.), alt (The "Alt" attribute text)
as-node:field-news-image:alt and node:field-news-image:file (for Digest template) are not working
I'm sure I have enabled and added a tag text to the content item used for sending the email. Only the text "teaser image" was visible (I have taken care that the email client could not access the image, so the alt text should become visible)
{{[subs:items:index:#0:as-node:field_news_image]==?:<td valign="top"><img src="[subs:items:index:#0:as-node:field_news_image]" alt="[as:node:field-news-image:alt]teaser image" width="100" /></td>}}
<td style="font-family: Calibri, Arial, Helvetica, sans-serif;" valign="top" align="left">[subs:items:index:#0:as-node:summary]</td>
Comments
Comment #1
salvisThese tokens are provided by the Entity Token module and the question mark stands for the delta (the index) of the field value. You could have an image field with more than one image, but AFAIK, Entity Token does not provide a way to find out how many you have.
IAC, "0" should give you the first image, i.e. [node:field-news-image:0:alt] should give you the Alt text of the first image. Again, that is functionality provided by a submodule of the Entity API module, and it's beyond the control of Subscriptions.
You seem to be implementing a sophisticated template. Would you care to post a screenshot of a typical notification together with the template and any other required ingredients, once you're done? That could be a great resource for other Subscriptions users.
Comment #2
herbiek commentedYou're sure I have to use node:field-news-image:0:alt ?
I tried also as-node, 1:alt, 2:alt, neither working, all these variables result in empty result. The fixed text between the "" is shown as expected.
If I'm ready I will make a screenshot with the template used for it. I'm gonna blurr the parts that refer to our company.
Comment #3
salvisWell, yes, [subs:items:index:#0:as-node:field-news-image:0:alt]