Code snipit needed for Blog List transformation to show Teaser Image

Taun Brown asked on March 26, 2014 10:08

can someone post the needed code that I would need to add to a transformation to show the teaser image of a blog post so I can display it on the recent post lists. I have check a lot of my current templates and transformation and have not been able to find it.

Thanks in advance.

Correct Answer

Brenden Kehren answered on March 26, 2014 12:27

If you go into any transformation and click the link directly above to the right of the transformation box that says Transformation Examples, this will have several methods you can use to get an image. The simplest would be <%# GetImage("BlogPostTeaser") %> This will generate the full < img > tag for you.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Steve Pine answered on April 28, 2014 17:53

Brendan: thanks for your response on this. I'm attempting the same with new blog. but does this code get added to an existing transformation or does it have to exist on it's own? I've included sample and screenshot below:

http://www.czs.org/CZS/getmedia/0118bc72-0540-40e9-bcff-fc64ad9f3fba/blog-teaser-question.aspx

Existing Code in Transformation

**

<%# Eval("BlogDescription") %>


**

thank you!

0 votesVote for this answer Mark as a Correct answer

Steve Pine answered on April 28, 2014 17:55

Sorry, here is the full code on transformation:

<%# Eval("BlogDescription") %>


0 votesVote for this answer Mark as a Correct answer

Josh Lee answered on July 24, 2014 20:41

How can you add a class to that image tag that gets returned from GetImage?

0 votesVote for this answer Mark as a Correct answer

Martin Danko answered on August 1, 2014 10:36

Hello Josh,

you will need to write a Custom method for transformation.

Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.