Skip to content

Commit

Permalink
Also use IMAGE_FIELD_NAME config attributes in leadimage-body.pt
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed May 17, 2013
1 parent f75f133 commit cb4d24b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,7 @@ Changelog
1.3.5 (unreleased)
------------------

- Also use IMAGE_FIELD_NAME config attributes in leadimage-body.pt [thet]
- Fixed blob based images not being language neutral [miohtama]
- Add french translation [toutpt]

Expand Down
2 changes: 1 addition & 1 deletion src/collective/contentleadimage/browser/leadimage-body.pt
Expand Up @@ -3,7 +3,7 @@
tal:condition="tag">

<a href="#"
tal:attributes="href string:${context/absolute_url}/leadImage/image_view_fullscreen"
tal:attributes="href string:${context/absolute_url}/${view/image_field_name}/image_view_fullscreen"
id="parent-fieldname-leadImage">
<img tal:replace="structure tag" src="" alt="" />
</a>
Expand Down
5 changes: 5 additions & 0 deletions src/collective/contentleadimage/browser/viewlets.py
Expand Up @@ -11,6 +11,11 @@
class LeadImageViewlet(ViewletBase):
""" A simple viewlet which renders leadimage """

def __init__(self, *args, **kwargs):
super(LeadImageViewlet, self).__init__(*args, **kwargs)
self.image_field_name = IMAGE_FIELD_NAME
self.image_caption_field_name = IMAGE_CAPTION_FIELD_NAME

@property
def prefs(self):
portal = getUtility(IPloneSiteRoot)
Expand Down
5 changes: 2 additions & 3 deletions src/collective/contentleadimage/config.py
@@ -1,14 +1,13 @@
# obsolete - used for migration from version < 1.0
CONTENT_LEADIMAGE_ANNOTATION_KEY = 'collective.contentleadimage'

# Please note, templates in browser directory uses field name directly
IMAGE_FIELD_NAME = 'leadImage'
IMAGE_CAPTION_FIELD_NAME = 'leadImage_caption'

# All upload images will be scaled to this size.
# Thumbnail will be created to value set in the preferences - (81,67) by default
# Thumbnail will be created to value set in preferences - (81,67) by default
IMAGE_SCALE_NAME = 'leadimage'
IMAGE_SCALE_SIZE = (81,67)
IMAGE_SCALE_SIZE = (81, 67)

IMAGE_SIZES = {'large' : (768, 768),
'preview' : (400, 400),
Expand Down

0 comments on commit cb4d24b

Please sign in to comment.