I have a list of news items which I need to create a rapido view for. The title and description of the news item are displayed ok, however, the image doesn't. It show's the image object or the name of the image without it being displayed correctly.
Here's the code:
foxynews.py:
def foxynews(context):
content = context.portal['foxynews']
# content = subcontext.content
items = content.listFolderContents(
contentFilter={"portal_type" : "News Item"}
)
return [{
'link_class':"gl-link-{}".format(item.id),
'url':item.absolute_url(),
'title':item.title,
'description': item.description,
'image': item.image
} for item in items]
foxynews.pt:
<div class="gl-container">
<div class="content-item" tal:repeat="programme elements/programmes">
<a class="content-item-wrapper w-inline-block" tal:attributes="href programme/url">
<div class="content-item-image-holder">
<img class="content-item-image"
tal:attributes="src string:${programme/url}/@@image/${programme/image/filename}"
>
</div>
<div class="content-item-text-holder">
<h2 class="content-item-heading" tal:content="programme/title" ></h2>
<div class="content-item-description" tal:content="programme/description" ></div>
</div>
</a>
</div>
foxynews.yaml:
elements:
foxynews:
type: BASIC