Forum Discussion
Hi
We're trying to do almost the same... but i was wondering if there is an rest api method to retreive images from the blog teaser. There is an api call for the images contained in a blog message (example: http://community.lithium.com/restapi/vc/messages/id/128039/images ), but i can't found the teaser's images.
In the example you provide, we need to manually parse the teaser string, which is quite tedious and having it in a rest call would simplify the customisation on a blog page...
regards
JC
Hi jc758
The images are normally included as a part of the teaser body. Therefore it's not possible to expose a rest call, simply because the teaser can really be anything - it's a text field that the user can populate with arbitrary HTML markup and it's not safe to assume that a teaser image will always be present in your code.
A potential improvement would be to include the image parsing logic in a Macro - so that you can define it once in the Endpoints section in Studio and maintain it in one place, then simply use the macro on the teaser content in your components which would greatly clean up your logic.
Hope this helps,
- jc75811 years agoAdvisor
Hi Paolo
thanx for the answer.
Well, from my point of view (i'm not into the product team :smileyhappy:) i don't see the difference between the Teaser html field and the Body html field...
the Body is also a text field that the user can populate with arbitrary HTML...
As it seems to be the same, adding a rest call for images of that field or include the images contained in the teaser in message/image method doesn't seem to be impossible... (as http://community.lithium.com/restapi/vc/messages/id/128039/images).
Well i'll create a macro as well, many thanx.
JC
- PaoloT11 years agoLithium Alumni (Retired)
Hi jc758
thanks for sharing your point of view. I think it would be very beneficial to post an idea so that our product managers will have a chance to review your feedback.
In the meantime, let us know if you managed to progress with the macro.
Kind Regards,
Related Content
- 5 years ago
- 13 years agoInactive User