Hi I like to have an Image Displayed within the Content of an Article. The
Content ist stored in a db table.
Up till now I simply displayed the content by this line {{Article.Content}}
I thought an image with text flowing around the image would freshen up the
article.
I tried the following I put somewhere in the content of my article
<<Image>> and replace that Tag with the image.
{{import string}}
{{try:}}
{{content=string.replace(Article.Content, "<<Image>>",
"IMG(_src=URL(r=request, c='default',
f='download',args=Article.InTextImage.thumb),_style='display:block;')")}}
{{except:}}
{{content=string.replace(Article.Content, "<<Image>>", "")}}
{{pass}}
{{=content}}
I put the whole part into a try clause so no errors are raised when There
is no Image stored for an Article.
What happens is that every time the except part is executed only removing
my tag.
Is it even possible to do put the Image in a Text that way?
--