Skip to content

Commit

Permalink
Don't try to show IContentLeadImage images, if theree none. Use the '…
Browse files Browse the repository at this point in the history
…mini' scale as default scale for IContentLeadImage
  • Loading branch information
thet committed Mar 11, 2015
1 parent dcea988 commit e831bcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGES.rst
Expand Up @@ -4,6 +4,10 @@ Changelog
1.2 (unreleased)
----------------

- Don't try to show IContentLeadImage images, if theree none. Use the "mini"
scale as default scale for IContentLeadImage.
[thet]

- Improve handling of Link types with other URL schemes than ``http://`` and
``https://``.
[thet]
Expand Down
11 changes: 6 additions & 5 deletions plone/app/contenttypes/behaviors/leadimage.pt
@@ -1,5 +1,6 @@
<div class="leadImage"
tal:condition="view/available">
<img tal:define="scale context/@@images"
tal:replace="structure python: scale.scale('image', width=200, height=200).tag(css_class='newsImage')" />
</div>
<div class="leadImage" tal:condition="view/available">
<img tal:define="has_img context/image|nothing;
scales context/@@images|nothing"
tal:condition="python:has_img and scales"
tal:replace="structure python: scales.scale('image', scale='mini').tag(css_class='newsImage')" />
</div>

0 comments on commit e831bcc

Please sign in to comment.